@cloudflare/vite-plugin 1.54.4 → 1.54.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1686 +1,1612 @@
1
1
  import { Pipeline, PipelineRecord } from "cloudflare:pipelines";
2
2
 
3
- //#region ../config/dist/public-DZgNmLyp.d.mts
3
+ //#region ../config/dist/public-E85Be_2R.d.mts
4
4
 
5
- //#region src/utils.d.ts
5
+ //#region src/inference.d.ts
6
6
  /**
7
- * Represents any valid JSON value.
7
+ * The Worker's entry module, imported with the `{ type: "cf-worker" }` import attribute
8
+ * @example
9
+ * ```ts
10
+ * import * as entrypoint from "./src" with { type: "cf-worker" };
11
+ * ```
8
12
  */
9
- type Json = string | number | boolean | null | Json[] | {
10
- [key: string]: Json;
11
- };
12
- //#endregion
13
- //#region src/bindings.d.ts
14
- /** Options that control a binding during local development. */
15
- interface BindingDevOptions {
16
- /** Whether the binding should connect to the remote resource. */
17
- remote?: boolean;
18
- }
19
- interface AgentMemoryBindingOptions {
20
- /** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
21
- namespace: string;
22
- /** Options that only apply during local development. */
23
- dev?: BindingDevOptions;
24
- }
13
+ type WorkerModule = Record<string, any>;
25
14
  /**
26
- * Agent Memory namespace binding. Each binding is scoped to a namespace and
27
- * allows agents to persist and recall memory.
15
+ * Default module type representing an unknown Worker's exports.
16
+ * - default export can be `ExportedHandler` or a `WorkerEntrypoint` class constructor
17
+ * - named exports can be `WorkerEntrypoint`, `DurableObject`, or `WorkflowEntrypoint` class constructors
28
18
  */
29
- interface AgentMemoryBinding extends AgentMemoryBindingOptions {
30
- type: "agent-memory";
31
- }
32
- interface AiBindingOptions {
33
- /** Options that only apply during local development. */
34
- dev?: BindingDevOptions;
19
+ interface DefaultModule {
20
+ default?: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded>;
21
+ [key: string]: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded> | Constructor<Rpc.DurableObjectBranded> | Constructor<Rpc.WorkflowEntrypointBranded> | undefined;
35
22
  }
36
23
  /**
37
- * Binding to the Workers AI project.
38
- *
39
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
24
+ * Represents a class constructor that creates instances of TInstance.
40
25
  */
41
- interface AiBinding extends AiBindingOptions {
42
- type: "ai";
43
- }
26
+ type Constructor<TInstance> = new (...args: any[]) => TInstance;
44
27
  /**
45
- * Binding to the Workers AI project.
46
- *
47
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
28
+ * Extracts the instance type from a class constructor if it extends `TInstance`.
48
29
  */
49
- interface TypedAiBinding<TAiModelList extends AiModelListType = AiModels> extends AiBinding {
50
- /** @internal Carries type parameters for inference */
51
- __typeParams: [TAiModelList];
52
- }
53
- interface AiSearchBindingOptions {
54
- /** The user-chosen instance name. Must exist in Cloudflare at deploy time. */
55
- name: string;
56
- /** Options that only apply during local development. */
57
- dev?: BindingDevOptions;
58
- }
30
+ type ExtractInstance<T$1, TInstance> = T$1 extends Constructor<TInstance> ? InstanceType<T$1> : never;
59
31
  /**
60
- * AI Search instance binding. Each binding is bound directly to a single
61
- * pre-existing instance within the "default" namespace.
32
+ * Mapping from binding type literals to Cloudflare runtime types.
33
+ *
34
+ * Entries fall into two groups:
35
+ * - Parameterized bindings (ai, json, kv, pipeline, queue, text) refine their
36
+ * runtime type from the binding instance via nominal matches against the
37
+ * `Typed*Binding` / `JsonBinding` / `TextBinding` interfaces from
38
+ * `./bindings`. When `TBinding` does not match, the entry falls back to the
39
+ * unparameterized runtime type.
40
+ * - Non-parameterized bindings map their type literal directly to a runtime
41
+ * type and ignore `TBinding`.
42
+ *
43
+ * IMPORTANT: The right-hand-side identifiers in this map (e.g. `KVNamespace`,
44
+ * `ImagesBinding`, `Fetcher`) must resolve to the ambient runtime types from
45
+ * `@cloudflare/workers-types`, not to local config interfaces. Several local
46
+ * binding interfaces in `./bindings.ts` (`ImagesBinding`, `MediaBinding`,
47
+ * `StreamBinding`) share names with ambient globals — importing those local
48
+ * types into this file silently shadows the globals and breaks `InferEnv`.
49
+ * Only import the `Typed*Binding`, `JsonBinding`, and `TextBinding` interfaces
50
+ * from `./bindings` (their names do not collide with ambient globals); never
51
+ * widen the import to a wildcard or to the plain `*Binding` interfaces.
62
52
  */
63
- interface AiSearchBinding extends AiSearchBindingOptions {
64
- type: "ai-search";
65
- }
66
- interface AiSearchNamespaceBindingOptions {
67
- /** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
68
- namespace: string;
69
- /** Options that only apply during local development. */
70
- dev?: BindingDevOptions;
53
+ interface BindingTypeMap<TBinding> {
54
+ ai: TBinding extends TypedAiBinding<infer T> ? Ai<T> : Ai;
55
+ json: TBinding extends JsonBinding<infer T> ? T : never;
56
+ kv: TBinding extends TypedKvBinding<infer T> ? KVNamespace<T> : KVNamespace;
57
+ pipeline: TBinding extends TypedPipelineBinding<infer T> ? Pipeline<T> : Pipeline;
58
+ queue: TBinding extends TypedQueueBinding<infer T> ? Queue<T> : Queue;
59
+ text: TBinding extends TextBinding<infer T> ? T : never;
60
+ "agent-memory": AgentMemoryNamespace;
61
+ "ai-search": AiSearchInstance;
62
+ "ai-search-namespace": AiSearchNamespace;
63
+ "analytics-engine-dataset": AnalyticsEngineDataset;
64
+ artifacts: Artifacts;
65
+ assets: Fetcher;
66
+ browser: BrowserRun;
67
+ d1: D1Database;
68
+ "dispatch-namespace": DispatchNamespace;
69
+ "durable-object": DurableObjectNamespace;
70
+ flagship: Flagship;
71
+ hyperdrive: Hyperdrive;
72
+ images: ImagesBinding;
73
+ logfwdr: any;
74
+ media: MediaBinding;
75
+ "mtls-certificate": Fetcher;
76
+ "rate-limit": RateLimit;
77
+ r2: R2Bucket;
78
+ secret: string;
79
+ "secrets-store-secret": SecretsStoreSecret;
80
+ "send-email": SendEmail;
81
+ stream: StreamBinding;
82
+ vectorize: VectorizeIndex;
83
+ "version-metadata": WorkerVersionMetadata;
84
+ "vpc-service": Fetcher;
85
+ "vpc-network": Fetcher;
86
+ "web-search": WebSearch;
87
+ worker: Fetcher;
88
+ "worker-loader": WorkerLoader;
89
+ workflow: Workflow;
71
90
  }
91
+ type SelectedWorkerExportName<TBinding> = TBinding extends {
92
+ exportName?: infer TExportName;
93
+ } ? TExportName extends string ? TExportName : "default" : "default";
94
+ type InferBindingType<TBinding> = TBinding extends {
95
+ type: "worker";
96
+ worker: infer TWorker extends WorkerReference;
97
+ } ? TWorker extends string ? Fetcher : InferMainModule<UnwrapConfig<TWorker>> extends infer TModule extends WorkerModule ? SelectedWorkerExportName<TBinding> extends infer TExportName ? TExportName extends keyof TModule ? TModule[TExportName] extends Constructor<any> ? Fetcher<ExtractInstance<TModule[TExportName], Rpc.WorkerEntrypointBranded>> : Fetcher : never : never : never : TBinding extends {
98
+ type: "durable-object";
99
+ worker: infer TWorker extends WorkerReference;
100
+ exportName: infer TExportName extends string;
101
+ } ? TWorker extends string ? DurableObjectNamespace : InferMainModule<UnwrapConfig<TWorker>> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? DurableObjectNamespace<ExtractInstance<TModule[TExportName], Rpc.DurableObjectBranded>> : never : never : TBinding extends {
102
+ type: "workflow";
103
+ worker: infer TWorker extends WorkerReference;
104
+ exportName: infer TExportName extends string;
105
+ } ? TWorker extends string ? Workflow : InferMainModule<UnwrapConfig<TWorker>> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? ExtractInstance<TModule[TExportName], Rpc.WorkflowEntrypointBranded> extends infer TWorkflow ? TWorkflow extends {
106
+ run(event: {
107
+ payload: infer P;
108
+ }, step: any): any;
109
+ } ? Workflow<P> : Workflow : Workflow : never : never : TBinding extends {
110
+ type: `unsafe:${string}`;
111
+ } ? any : TBinding extends {
112
+ type: infer K extends keyof BindingTypeMap<TBinding>;
113
+ } ? BindingTypeMap<TBinding>[K] : never;
72
114
  /**
73
- * AI Search namespace binding. Each binding is scoped to a namespace and
74
- * allows dynamic instance CRUD within it.
115
+ * Infer export names from a config's exports, optionally filtered by type.
116
+ * When TExportType is `string` (default), returns all export names.
117
+ * When TExportType is a specific literal like `"durable-object"` or `"workflow"`,
118
+ * returns only exports of that type.
75
119
  */
76
- interface AiSearchNamespaceBinding extends AiSearchNamespaceBindingOptions {
77
- type: "ai-search-namespace";
78
- }
79
- interface AnalyticsEngineDatasetBindingOptions {
80
- /** The name of this dataset to write to. */
81
- name?: string;
82
- }
120
+ type InferExportsByType<TUnwrappedConfig, TExportType extends string = string> = TUnwrappedConfig extends {
121
+ exports: infer TExports extends Record<string, {
122
+ type: string;
123
+ }>;
124
+ } ? { [K in keyof TExports]: TExports[K] extends {
125
+ type: TExportType;
126
+ } ? K & string : never }[keyof TExports] : never;
83
127
  /**
84
- * Binding to an Analytics Engine dataset.
85
- *
86
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
128
+ * Infer `WorkerEntrypoint` export names from a config.
129
+ * Returns named module exports that are not declared as type `"durable-object"` or `"workflow"` in `exports`.
130
+ * Excludes `"default"` since `exportName` should only be provided for named exports.
87
131
  */
88
- interface AnalyticsEngineDatasetBinding extends AnalyticsEngineDatasetBindingOptions {
89
- type: "analytics-engine-dataset";
90
- }
91
- interface ArtifactsBindingOptions {
92
- /** The namespace to use. */
93
- namespace: string;
94
- /** Options that only apply during local development. */
95
- dev?: BindingDevOptions;
96
- }
132
+ type InferWorkerEntrypointExports<TUnwrappedConfig> = Exclude<keyof InferMainModule<TUnwrappedConfig> & string, "default" | InferExportsByType<TUnwrappedConfig, "durable-object" | "workflow">>;
97
133
  /**
98
- * Binding to an Artifacts instance. Artifacts provides git-compatible file
99
- * storage on Cloudflare Workers.
134
+ * Unwrap function and promise types to get the underlying config.
135
+ * Use this to normalize a config before passing it to other inference utilities.
100
136
  */
101
- interface ArtifactsBinding extends ArtifactsBindingOptions {
102
- type: "artifacts";
103
- }
137
+ type UnwrapConfig<TConfig$1> = TConfig$1 extends ((...args: any[]) => infer TReturn) ? UnwrapConfig<TReturn> : TConfig$1 extends Promise<infer TCompletion> ? UnwrapConfig<TCompletion> : TConfig$1;
104
138
  /**
105
- * Binding to the Worker's static assets.
139
+ * Infer the `Env` interface type from a Worker config.
106
140
  *
107
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
108
- */
109
- interface AssetsBinding {
110
- type: "assets";
111
- }
112
- interface BrowserBindingOptions {
113
- /** Options that only apply during local development. */
114
- dev?: BindingDevOptions;
115
- }
116
- /**
117
- * Binding to a headless browser usable from the Worker.
141
+ * Transforms a config object's `env` bindings into their
142
+ * corresponding Cloudflare runtime types.
118
143
  *
119
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
120
- */
121
- interface BrowserBinding extends BrowserBindingOptions {
122
- type: "browser";
123
- }
124
- interface D1BindingOptions {
125
- /** The UUID of this D1 database (not required). */
126
- id?: string;
127
- /** The name of this D1 database. */
128
- name?: string;
129
- /** Options that only apply during local development. */
130
- dev?: BindingDevOptions;
131
- }
132
- /**
133
- * Binding to a D1 database.
144
+ * @example
145
+ * ```typescript
146
+ * import { defineWorker, bindings } from "@cloudflare/config";
147
+ * import type { InferEnv, UnwrapConfig } from "@cloudflare/config";
134
148
  *
135
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
136
- */
137
- interface D1Binding extends D1BindingOptions {
138
- type: "d1";
139
- }
140
- interface DispatchNamespaceBindingOptions {
141
- /** The namespace to bind to. */
142
- namespace?: string;
143
- /** Details about the outbound Worker which will handle outbound requests from your namespace. */
144
- outbound?: {
145
- /** Name of the Worker handling the outbound requests. */
146
- worker: string;
147
- /** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler. */
148
- parameters?: string[];
149
- };
150
- /** Options that only apply during local development. */
151
- dev?: BindingDevOptions;
152
- }
153
- /**
154
- * Binding to a Workers for Platforms dispatch namespace.
149
+ * const config = defineWorker({
150
+ * env: {
151
+ * MY_JSON: bindings.json({ id: string }),
152
+ * MY_KV: bindings.kv(),
153
+ * },
154
+ * });
155
155
  *
156
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
156
+ * type WorkerConfig = UnwrapConfig<typeof config>;
157
+ * // Inferred as: { MY_JSON: { id: string }; MY_KV: KVNamespace }
158
+ * export type Env = InferEnv<WorkerConfig>;
159
+ * ```
157
160
  */
158
- interface DispatchNamespaceBinding extends DispatchNamespaceBindingOptions {
159
- type: "dispatch-namespace";
160
- }
161
- interface DurableObjectBindingOptions {
162
- /** The name of the Worker that defines the Durable Object class. */
163
- worker: string;
164
- /** The exported class name of the Durable Object. */
165
- exportName: string;
166
- }
161
+ type InferEnv<TUnwrappedConfig> = TUnwrappedConfig extends {
162
+ env: infer TEnv extends Record<string, any>;
163
+ } ? { [K in keyof TEnv]: InferBindingType<TEnv[K]> } : never;
167
164
  /**
168
- * Binding to a Durable Object class. `worker` is the name of the Worker
169
- * that defines the class; `exportName` is the exported class name.
170
- *
171
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
172
- */
173
- interface DurableObjectBinding extends DurableObjectBindingOptions {
165
+ * Infer the Durable Object namespace names from a Worker config's exports.
166
+ * Returns a union of export names that declare a *live* Durable Object —
167
+ * `type: "durable-object"` with `state` either omitted, `"created"`, or
168
+ * `"expecting-transfer"`. Tombstone entries (`deleted`, `renamed`,
169
+ * `transferred`) are excluded because they retire the namespace and a
170
+ * binding to a tombstoned class would fail at deploy time.
171
+ *
172
+ * @example
173
+ * ```typescript
174
+ * import { defineWorker } from "@cloudflare/config";
175
+ * import type { InferDurableNamespaces, UnwrapConfig } from "@cloudflare/config";
176
+ *
177
+ * const config = defineWorker({
178
+ * exports: {
179
+ * MyDurableObject: { type: "durable-object", storage: "sqlite" },
180
+ * OldGone: { type: "durable-object", state: "deleted" },
181
+ * },
182
+ * });
183
+ *
184
+ * type WorkerConfig = UnwrapConfig<typeof config>;
185
+ * // Inferred as: "MyDurableObject" (the deleted tombstone is excluded)
186
+ * type DurableNamespaces = InferDurableNamespaces<WorkerConfig>;
187
+ * ```
188
+ */
189
+ type InferDurableNamespaces<TUnwrappedConfig> = TUnwrappedConfig extends {
190
+ exports: infer TExports extends Record<string, {
191
+ type: string;
192
+ }>;
193
+ } ? { [K in keyof TExports]: TExports[K] extends {
174
194
  type: "durable-object";
175
- }
195
+ } ? TExports[K] extends {
196
+ state: "deleted" | "renamed" | "transferred";
197
+ } ? never : K & string : never }[keyof TExports] : never;
176
198
  /**
177
- * Binding to a Durable Object class. `worker` is the name of the Worker
178
- * that defines the class; `exportName` is the exported class name.
179
- *
180
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
199
+ * Infer the main module type from a Worker config's entrypoint.
200
+ * If entrypoint is a module namespace object, returns that type.
201
+ * If entrypoint is a `string` or not present, returns `DefaultModule` as a fallback.
181
202
  */
182
- interface TypedDurableObjectBinding<TConfig$1, TExportName$1 extends string> extends DurableObjectBinding {
183
- worker: string;
184
- exportName: TExportName$1;
185
- /** @internal Carries the config type for inference */
186
- __config: TConfig$1;
187
- }
188
- interface FlagshipBindingOptions {
189
- /** The Flagship app ID to bind to. */
190
- id?: string;
191
- /** Options that only apply during local development. */
192
- dev?: BindingDevOptions;
193
- }
194
- /** Binding to a Flagship feature-flag service. */
195
- interface FlagshipBinding extends FlagshipBindingOptions {
196
- type: "flagship";
197
- }
198
- interface HyperdriveBindingOptions {
199
- /** The ID of the Hyperdrive configuration. */
200
- id: string;
201
- /** Options that only apply during local development. */
202
- dev?: {
203
- /** The database connection string used during local development. */
204
- connectionString?: string;
205
- };
206
- }
203
+ type InferMainModule<TUnwrappedConfig> = TUnwrappedConfig extends {
204
+ entrypoint: infer TModule extends WorkerModule;
205
+ } ? TModule : DefaultModule;
206
+ //#endregion
207
+ //#region src/utils.d.ts
207
208
  /**
208
- * Binding to a Hyperdrive configuration.
209
- *
210
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
209
+ * Represents any valid JSON value.
211
210
  */
212
- interface HyperdriveBinding extends HyperdriveBindingOptions {
213
- type: "hyperdrive";
214
- }
215
- interface ImagesBindingOptions {
216
- /** Options that only apply during local development. */
217
- dev?: BindingDevOptions;
211
+ type Json = string | number | boolean | null | Json[] | {
212
+ [key: string]: Json;
213
+ };
214
+ //#endregion
215
+ //#region src/definition.d.ts
216
+ interface ConfigContext {
217
+ /**
218
+ * The mode the config is being evaluated in.
219
+ * Set via the `--mode` CLI flag.
220
+ * In Vite the mode defaults to `development` in `vite dev` and `production` in `vite build` ([more info](https://vite.dev/guide/env-and-mode.html#modes)).
221
+ * In Wrangler the mode defaults to `undefined`.
222
+ */
223
+ mode: string | undefined;
218
224
  }
219
225
  /**
220
- * Binding to Cloudflare Images.
221
- *
222
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
226
+ * The authored config in any of its supported shapes: a plain value, a promise,
227
+ * or a function of {@link ConfigContext}.
223
228
  */
224
- interface ImagesBinding$1 extends ImagesBindingOptions {
225
- type: "images";
226
- }
229
+ type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
230
+ type ConfigObject = Record<string, unknown>;
231
+ type ConfigWithType<T$1 extends ConfigObject, TType extends string> = T$1 & {
232
+ type: TType;
233
+ };
234
+ //#endregion
235
+ //#region src/exports.d.ts
227
236
  /**
228
- * Inline JSON value made available to the Worker on `env` under the
229
- * binding name.
237
+ * Storage backend for the Durable Object.
238
+ *
239
+ * Containers are only supported on the SQLite storage engine, so `container` is
240
+ * only offered alongside `storage: "sqlite"`.
230
241
  */
231
- interface JsonBinding<T$1 extends Json = Json> {
232
- type: "json";
233
- /** The JSON value made available to the Worker. */
234
- value: T$1;
235
- }
236
- interface KvBindingOptions {
237
- /** The ID of the KV namespace. */
238
- id?: string;
239
- /** Options that only apply during local development. */
240
- dev?: BindingDevOptions;
241
- }
242
+ type DurableObjectStorageOptions = {
243
+ /**
244
+ * Selects the SQLite-backed storage engine (recommended for new
245
+ * classes).
246
+ */
247
+ storage: "sqlite";
248
+ /**
249
+ * Attach a container to this Durable Object, by container name. The
250
+ * name must match an entry in the top level `containers` array.
251
+ */
252
+ container?: string;
253
+ } | {
254
+ /** Selects the legacy key-value storage engine. */
255
+ storage: "legacy-kv";
256
+ };
242
257
  /**
243
- * Binding to a Workers KV namespace.
258
+ * Declares a provisioned Durable Object class exported from this Worker.
244
259
  *
245
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
260
+ * For more information about Durable Objects, see the documentation at
261
+ * https://developers.cloudflare.com/workers/learning/using-durable-objects
262
+ *
263
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
246
264
  */
247
- interface KvBinding extends KvBindingOptions {
248
- type: "kv";
249
- }
265
+ type DurableObjectCreatedExportOptions = {
266
+ state?: "created";
267
+ } & DurableObjectStorageOptions;
250
268
  /**
251
- * Binding to a Workers KV namespace.
269
+ * Retire a provisioned Durable Object namespace whose class has
270
+ * been removed from code.
252
271
  *
253
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
272
+ * During deploy, the class must not be exported in the uploaded code, and no
273
+ * other Worker may hold a `durableObject` binding to the namespace.
254
274
  */
255
- interface TypedKvBinding<TKey extends string = string> extends KvBinding {
256
- /** @internal Carries type parameters for inference */
257
- __typeParams: [TKey];
258
- }
259
- interface LogfwdrBindingOptions {
260
- /** The destination for this logged message. */
261
- destination: string;
262
- }
263
- /** Binding for forwarding logs to logfwdr. */
264
- interface LogfwdrBinding extends LogfwdrBindingOptions {
265
- type: "logfwdr";
266
- }
267
- interface MediaBindingOptions {
268
- /** Options that only apply during local development. */
269
- dev?: BindingDevOptions;
275
+ interface DurableObjectDeletedExportOptions {
276
+ state: "deleted";
270
277
  }
271
- /** Binding to Cloudflare Media Transformations. */
272
- interface MediaBinding$1 extends MediaBindingOptions {
273
- type: "media";
278
+ /**
279
+ * Rename a provisioned Durable Object namespace's class. The
280
+ * `renamedTo` value must also appear as a live (`state: "created"`)
281
+ * `durableObject` entry in the same `exports` map.
282
+ */
283
+ interface DurableObjectRenamedExportOptions {
284
+ state: "renamed";
285
+ /**
286
+ * The destination class name. Must be a valid JavaScript identifier and
287
+ * must appear as a live (`state: "created"`) `durableObject` entry in the
288
+ * same `exports` map.
289
+ */
290
+ renamedTo: string;
274
291
  }
275
- interface MtlsCertificateBindingOptions {
276
- /** The UUID of the uploaded mTLS certificate. */
277
- id: string;
278
- /** Options that only apply during local development. */
279
- dev?: BindingDevOptions;
292
+ /**
293
+ * Transfer ownership of a Durable Object namespace to another Worker in the same account.
294
+ * The target Worker must first deploy an `expectingTransfer` entry naming this Worker via `transferFrom`.
295
+ */
296
+ interface DurableObjectTransferredExportOptions {
297
+ state: "transferred";
298
+ /**
299
+ * The destination Worker. Must reference a Worker in the same account.
300
+ */
301
+ transferredTo: string;
280
302
  }
281
303
  /**
282
- * Binding to an uploaded mTLS certificate.
283
- *
284
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
304
+ * Prepare to receive cross-Worker Durable Object transfer.
305
+ * Once the source Worker's `transferred` export is deployed, this entry becomes a normal live `durable-object` export.
285
306
  */
286
- interface MtlsCertificateBinding extends MtlsCertificateBindingOptions {
287
- type: "mtls-certificate";
307
+ type DurableObjectExpectingTransferExportOptions = {
308
+ state: "expecting-transfer";
309
+ /**
310
+ * The source Worker for the two-phase cross-Worker transfer.
311
+ */
312
+ transferFrom: string;
313
+ } & DurableObjectStorageOptions;
314
+ type DurableObjectCreatedExport = DurableObjectCreatedExportOptions & {
315
+ type: "durable-object";
316
+ };
317
+ interface DurableObjectDeletedExport extends DurableObjectDeletedExportOptions {
318
+ type: "durable-object";
288
319
  }
289
- interface PipelineBindingOptions {
290
- /** Name of the Pipeline to bind. */
291
- name: string;
292
- /** Options that only apply during local development. */
293
- dev?: BindingDevOptions;
320
+ interface DurableObjectRenamedExport extends DurableObjectRenamedExportOptions {
321
+ type: "durable-object";
294
322
  }
295
- /** Binding to a Cloudflare Pipeline. */
296
- interface PipelineBinding extends PipelineBindingOptions {
297
- type: "pipeline";
323
+ interface DurableObjectTransferredExport extends DurableObjectTransferredExportOptions {
324
+ type: "durable-object";
298
325
  }
299
- /** Binding to a Cloudflare Pipeline. */
300
- interface TypedPipelineBinding<TRecord extends PipelineRecord = PipelineRecord> extends PipelineBinding {
301
- /** @internal Carries type parameters for inference */
302
- __typeParams: [TRecord];
326
+ type DurableObjectExpectingTransferExport = DurableObjectExpectingTransferExportOptions & {
327
+ type: "durable-object";
328
+ };
329
+ type DurableObjectExportOptions = DurableObjectCreatedExportOptions | DurableObjectDeletedExportOptions | DurableObjectRenamedExportOptions | DurableObjectTransferredExportOptions | DurableObjectExpectingTransferExportOptions;
330
+ type DurableObjectExports = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport;
331
+ interface WorkerEntrypointExportOptions {
332
+ cache?: {
333
+ /** Whether cache is enabled for this entrypoint. */
334
+ enabled: boolean;
335
+ };
303
336
  }
304
- interface QueueBindingOptions {
305
- /** The name of this Queue. */
306
- name?: string;
307
- /** The number of seconds to wait before delivering a message. */
308
- deliveryDelay?: number;
309
- /** Options that only apply during local development. */
310
- dev?: BindingDevOptions;
337
+ interface WorkerEntrypointExport extends WorkerEntrypointExportOptions {
338
+ type: "worker";
311
339
  }
312
340
  /**
313
- * Producer binding to a Cloudflare Queue.
314
- *
315
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
341
+ * Configuration for named exports declared by the Worker. Each entry's
342
+ * key is the exported class name; the value configures the export.
316
343
  */
317
- interface QueueBinding extends QueueBindingOptions {
318
- type: "queue";
344
+ interface Exports {
345
+ /**
346
+ * Declares a Durable Object class defined by this Worker.
347
+ *
348
+ * For more information about Durable Objects, see the documentation at
349
+ * https://developers.cloudflare.com/workers/learning/using-durable-objects
350
+ *
351
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
352
+ */
353
+ durableObject(options: DurableObjectCreatedExportOptions): DurableObjectCreatedExport;
354
+ /**
355
+ * Retire a provisioned Durable Object namespace whose class has been removed from code.
356
+ */
357
+ durableObject(options: DurableObjectDeletedExportOptions): DurableObjectDeletedExport;
358
+ /**
359
+ * Rename a provisioned Durable Object namespace's class.
360
+ */
361
+ durableObject(options: DurableObjectRenamedExportOptions): DurableObjectRenamedExport;
362
+ /**
363
+ * Transfer ownership of a Durable Object namespace to another Worker in the same account.
364
+ */
365
+ durableObject(options: DurableObjectTransferredExportOptions): DurableObjectTransferredExport;
366
+ /**
367
+ * Prepare to receive cross-Worker Durable Object transfer.
368
+ * The source Worker must follow up with a deployment containing a `transferred` export to commit the transfer.
369
+ */
370
+ durableObject(options: DurableObjectExpectingTransferExportOptions): DurableObjectExpectingTransferExport;
371
+ durableObject(options: DurableObjectExportOptions): DurableObjectExports;
372
+ /** Declares a WorkerEntrypoint export defined by this Worker. */
373
+ worker(options?: WorkerEntrypointExportOptions): WorkerEntrypointExport;
319
374
  }
320
375
  /**
321
- * Producer binding to a Cloudflare Queue.
376
+ * Exports builder for configuring Worker exports.
322
377
  *
323
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
378
+ * @example
379
+ * ```typescript
380
+ * import { defineWorker, exports } from "@cloudflare/config";
381
+ *
382
+ * export default defineWorker({
383
+ * exports: {
384
+ * MyDurableObject: exports.durableObject({ storage: "sqlite" }),
385
+ * MyContainerDO: exports.durableObject({ storage: "sqlite", container: "my-container" }),
386
+ * OldClass: exports.durableObject({ state: "deleted" }),
387
+ * OldName: exports.durableObject({ state: "renamed", renamedTo: "NewName" }),
388
+ * Outgoing: exports.durableObject({ state: "transferred", transferredTo: "target-worker" }),
389
+ * Incoming: exports.durableObject({ state: "expecting-transfer", storage: "sqlite", transferFrom: "source-worker" }),
390
+ * },
391
+ * });
392
+ * ```
324
393
  */
325
- interface TypedQueueBinding<TBody = unknown> extends QueueBinding {
326
- /** @internal Carries type parameters for inference */
327
- __typeParams: [TBody];
328
- }
329
- interface R2BindingOptions {
330
- /** The name of this R2 bucket at the edge. */
331
- name?: string;
332
- /** The jurisdiction that the bucket exists in. Default if not present. */
333
- jurisdiction?: string;
334
- /** Settings that only apply to local development. */
335
- dev?: BindingDevOptions & {
336
- /** EXPERIMENTAL: credentials for the local S3-compatible endpoint. */
337
- experimentalS3Credentials?: {
338
- accessKeyId: string;
339
- secretAccessKey: string;
340
- };
341
- };
394
+ declare const exports: Exports;
395
+ //#endregion
396
+ //#region src/triggers.d.ts
397
+ interface FetchTriggerOptions {
398
+ /**
399
+ * A route that your Worker should be published to.
400
+ *
401
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
402
+ */
403
+ pattern: string;
404
+ /**
405
+ * The DNS zone the pattern is attached to. Required when the
406
+ * pattern is ambiguous.
407
+ */
408
+ zone?: string;
342
409
  }
343
410
  /**
344
- * Binding to an R2 bucket.
411
+ * Fetch trigger — a route that your Worker should be published to.
345
412
  *
346
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
413
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
347
414
  */
348
- interface R2Binding extends R2BindingOptions {
349
- type: "r2";
350
- }
351
- interface RateLimitBindingOptions {
352
- /** The namespace ID for this rate limiter. */
353
- namespace: string;
354
- /** Simple rate limiting configuration. */
355
- simple: {
356
- /** The maximum number of requests allowed in the time period. */
357
- limit: number;
358
- /** The time period in seconds (10 for ten seconds, 60 for one minute). */
359
- period: 10 | 60;
360
- };
415
+ interface FetchTrigger extends FetchTriggerOptions {
416
+ type: "fetch";
361
417
  }
362
- /** Binding to a rate limiter. */
363
- interface RateLimitBinding extends RateLimitBindingOptions {
364
- type: "rate-limit";
418
+ interface QueueConsumerTriggerOptions {
419
+ /** The name of the queue from which this consumer should consume. */
420
+ name: string;
421
+ /** The queue to send messages that failed to be consumed. */
422
+ deadLetterQueue?: string;
423
+ /** The maximum number of messages per batch. */
424
+ maxBatchSize?: number;
425
+ /** The maximum number of seconds to wait to fill a batch with messages. */
426
+ maxBatchTimeout?: number;
427
+ /**
428
+ * The maximum number of concurrent consumer Worker invocations.
429
+ * Leaving this unset will allow your consumer to scale to the
430
+ * maximum concurrency needed to keep up with the message backlog.
431
+ */
432
+ maxConcurrency?: number | null;
433
+ /** The maximum number of retries for each message. */
434
+ maxRetries?: number;
435
+ /** The number of seconds to wait before retrying a message. */
436
+ retryDelay?: number;
437
+ /** The number of milliseconds to wait for pulled messages to become visible again. */
438
+ visibilityTimeoutMs?: number;
365
439
  }
366
440
  /**
367
- * Declares a secret that is required by your Worker, exposed on `env` under
368
- * the binding name.
369
- *
370
- * When defined, this binding:
371
- * - Replaces .dev.vars/.env/process.env inference for type generation
372
- * - Enables local dev validation with warnings for missing secrets
441
+ * Queue consumer trigger — invokes this Worker when messages arrive on the
442
+ * named queue.
373
443
  *
374
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
444
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
375
445
  */
376
- interface SecretBinding {
377
- type: "secret";
378
- }
379
- interface SecretsStoreSecretBindingOptions {
380
- /** ID of the secret store. */
381
- storeId: string;
382
- /** Name of the secret. */
383
- secretName: string;
446
+ interface QueueConsumerTrigger extends QueueConsumerTriggerOptions {
447
+ type: "queue";
384
448
  }
385
- /** Binding to a Secrets Store secret. */
386
- interface SecretsStoreSecretBinding extends SecretsStoreSecretBindingOptions {
387
- type: "secrets-store-secret";
449
+ interface ScheduledTriggerOptions {
450
+ /**
451
+ * A "cron" definition to trigger a Worker's "scheduled" function.
452
+ *
453
+ * Lets you call Workers periodically, much like a cron job.
454
+ *
455
+ * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
456
+ */
457
+ schedule: string;
388
458
  }
389
- type SendEmailDestinationOptions = {
390
- /** If this binding should be restricted to a specific verified address. */
391
- destinationAddress: string;
392
- allowedDestinationAddresses?: never;
393
- } | {
394
- destinationAddress?: never;
395
- /** If this binding should be restricted to a set of verified addresses. */
396
- allowedDestinationAddresses: string[];
397
- } | {
398
- destinationAddress?: never;
399
- allowedDestinationAddresses?: never;
400
- };
401
- type SendEmailBindingOptions = SendEmailDestinationOptions & {
402
- /** If this binding should be restricted to a set of sender addresses. */
403
- allowedSenderAddresses?: string[];
404
- /** Options that only apply during local development. */
405
- dev?: BindingDevOptions;
406
- };
407
459
  /**
408
- * Binding for sending email from inside the Worker.
460
+ * Scheduled (cron) trigger — invokes this Worker on the given schedules.
409
461
  *
410
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
462
+ * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
411
463
  */
412
- type SendEmailBinding = SendEmailBindingOptions & {
413
- type: "send-email";
414
- };
415
- interface StreamBindingOptions {
416
- /** Options that only apply during local development. */
417
- dev?: BindingDevOptions;
464
+ interface ScheduledTrigger extends ScheduledTriggerOptions {
465
+ type: "scheduled";
418
466
  }
419
- /** Binding to Cloudflare Stream. */
420
- interface StreamBinding$1 extends StreamBindingOptions {
421
- type: "stream";
467
+ interface EmailTriggerOptions {
468
+ /**
469
+ * Inbound Email Routing addresses handled by this Worker.
470
+ *
471
+ * Each entry is a literal recipient address (e.g. `"support@example.com"`)
472
+ * or a `*@domain` catch-all (e.g. `"*@example.com"`).
473
+ */
474
+ addresses: string[];
422
475
  }
423
476
  /**
424
- * Inline string value made available to the Worker on `env` under the
425
- * binding name.
426
- *
427
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
477
+ * Email trigger — invokes this Worker for the configured Email Routing
478
+ * addresses.
428
479
  */
429
- interface TextBinding<T$1 extends string = string> {
430
- type: "text";
431
- /** The string value made available to the Worker. */
432
- value: T$1;
480
+ interface EmailTrigger extends EmailTriggerOptions {
481
+ type: "email";
433
482
  }
434
- interface UnsafeBindingOptions {
435
- /** Local-dev plugin configuration for this unsafe binding. */
436
- dev?: {
437
- /** The plugin package that provides the binding's local-dev implementation. */
438
- plugin: {
439
- package: string;
440
- name: string;
441
- };
442
- /** Plugin-specific options. */
443
- options?: Record<string, unknown>;
444
- };
445
- [key: string]: unknown;
483
+ interface ConnectTriggerOptions {
484
+ /** The transport protocol to listen for. */
485
+ protocol: "tcp";
486
+ /** The port to listen on. */
487
+ port: number;
488
+ /** The address to bind to. Defaults to `127.0.0.1`. */
489
+ address?: string;
446
490
  }
447
491
  /**
448
- * Escape-hatch binding for runtime features that aren't directly supported
449
- * by this configuration. Included in the Worker's upload metadata without
450
- * changes.
492
+ * Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
493
+ * handler for raw socket connections received on the configured
494
+ * protocol/port.
451
495
  */
452
- interface UnsafeBinding extends UnsafeBindingOptions {
453
- type: `unsafe:${string}`;
454
- }
455
- interface VectorizeBindingOptions {
456
- /** The name of the Vectorize index. */
457
- name: string;
458
- /** Options that only apply during local development. */
459
- dev?: BindingDevOptions;
496
+ interface ConnectTrigger extends ConnectTriggerOptions {
497
+ type: "connect";
460
498
  }
461
499
  /**
462
- * Binding to a Vectorize index.
500
+ * Event triggers — fetch routes, queue consumers, cron schedules, Email
501
+ * Routing addresses, and raw sockets — that invoke this Worker.
502
+ * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
503
+ * `triggers.scheduled(...)`, `triggers.email(...)`, or `triggers.connect(...)`.
463
504
  *
464
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
505
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
465
506
  */
466
- interface VectorizeBinding extends VectorizeBindingOptions {
467
- type: "vectorize";
468
- }
469
- /** Binding to the Worker version's metadata. */
470
- interface VersionMetadataBinding {
471
- type: "version-metadata";
472
- }
473
- type VpcNetworkBindingOptions = {
474
- /** The tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with `networkId`. */
475
- tunnelId: string;
476
- networkId?: never;
477
- /** Options that only apply during local development. */
478
- dev?: BindingDevOptions;
479
- } | {
480
- tunnelId?: never;
481
- /** The network ID to route traffic through. Mutually exclusive with `tunnelId`. */
482
- networkId: string;
483
- /** Options that only apply during local development. */
484
- dev?: BindingDevOptions;
485
- };
486
- /** Binding to a VPC network. */
487
- type VpcNetworkBinding = VpcNetworkBindingOptions & {
488
- type: "vpc-network";
489
- };
490
- interface VpcServiceBindingOptions {
491
- /** The service ID of the VPC connectivity service. */
492
- id: string;
493
- /** Options that only apply during local development. */
494
- dev?: BindingDevOptions;
495
- }
496
- /** Binding to a VPC service. */
497
- interface VpcServiceBinding extends VpcServiceBindingOptions {
498
- type: "vpc-service";
499
- }
500
- interface WebSearchBindingOptions {
501
- /** Options that only apply during local development. */
502
- dev?: BindingDevOptions;
507
+ interface Triggers {
508
+ /**
509
+ * Fetch trigger — a route that your Worker should be published to.
510
+ *
511
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
512
+ */
513
+ fetch(options: FetchTriggerOptions): FetchTrigger;
514
+ /**
515
+ * Queue consumer trigger — invokes this Worker when messages arrive on the
516
+ * named queue.
517
+ *
518
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
519
+ */
520
+ queue(options: QueueConsumerTriggerOptions): QueueConsumerTrigger;
521
+ /**
522
+ * Scheduled (cron) trigger — invokes this Worker on the given schedules.
523
+ *
524
+ * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
525
+ */
526
+ scheduled(options: ScheduledTriggerOptions): ScheduledTrigger;
527
+ /**
528
+ * Email trigger — invokes this Worker for the configured Email Routing
529
+ * addresses.
530
+ */
531
+ email(options: EmailTriggerOptions): EmailTrigger;
532
+ /**
533
+ * Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
534
+ * handler for raw socket connections received on the configured
535
+ * protocol/port.
536
+ */
537
+ connect(options: ConnectTriggerOptions): ConnectTrigger;
503
538
  }
504
539
  /**
505
- * Cloudflare Web Search binding. There is exactly one shared web corpus, so
506
- * the binding is zero-config — only the variable name is required.
540
+ * Triggers builder for configuring event triggers.
541
+ *
542
+ * @example
543
+ * ```typescript
544
+ * import { defineWorker, triggers } from "@cloudflare/config";
545
+ *
546
+ * export default defineWorker({
547
+ * triggers: [
548
+ * triggers.fetch({ pattern: "example.com/*", zone: "example.com" }),
549
+ * triggers.queue({ name: "my-queue" }),
550
+ * triggers.scheduled({ schedule: "0 * * * *" }),
551
+ * triggers.scheduled({ schedule: "30 0 * * *" }),
552
+ * triggers.email({ addresses: ["support@example.com"] }),
553
+ * triggers.connect({ protocol: "tcp", port: 5432 }),
554
+ * ],
555
+ * });
556
+ * ```
507
557
  */
508
- interface WebSearchBinding extends WebSearchBindingOptions {
509
- type: "web-search";
510
- }
511
- interface WorkerBindingOptions {
512
- /** The name of the bound Worker. */
513
- worker: string;
514
- /** The named export to bind to (defaults to the default export). */
515
- exportName?: string;
516
- /** Optional properties that will be made available to the service via `ctx.props`. */
517
- props?: Record<string, unknown>;
518
- /** Options that only apply during local development. */
519
- dev?: BindingDevOptions;
520
- }
558
+ declare const triggers: Triggers;
559
+ //#endregion
560
+ //#region src/types.d.ts
521
561
  /**
522
- * Service binding (Worker-to-Worker). `worker` is the name of the bound
523
- * Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
524
- * the default export).
525
- *
526
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
562
+ * Union of all binding definitions accepted in `env`.
527
563
  */
528
- interface WorkerBinding extends WorkerBindingOptions {
529
- type: "worker";
530
- }
564
+ type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamespaceBinding | AnalyticsEngineDatasetBinding | ArtifactsBinding | AssetsBinding | BrowserBinding | D1Binding | DispatchNamespaceBinding | DurableObjectBinding | FlagshipBinding | HyperdriveBinding | ImagesBinding$1 | JsonBinding | KvBinding | LogfwdrBinding | MediaBinding$1 | MtlsCertificateBinding | PipelineBinding | QueueBinding | R2Binding | RateLimitBinding | SecretBinding | SecretsStoreSecretBinding | SendEmailBinding | StreamBinding$1 | TextBinding | UnsafeBinding | VectorizeBinding | VersionMetadataBinding | VpcNetworkBinding | VpcServiceBinding | WebSearchBinding | WorkerBinding | WorkerLoaderBinding;
531
565
  /**
532
- * Service binding (Worker-to-Worker). `worker` is the name of the bound
533
- * Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
534
- * the default export).
535
- *
536
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
566
+ * Union of all trigger definitions accepted in `triggers`.
537
567
  */
538
- interface TypedWorkerBinding<TConfig$1, TExportName$1 extends string> extends WorkerBinding {
539
- worker: string;
540
- exportName: TExportName$1;
541
- /** @internal Carries the config type for inference */
542
- __config: TConfig$1;
543
- }
544
- /** Binding to a Worker Loader. */
545
- interface WorkerLoaderBinding {
546
- type: "worker-loader";
547
- }
548
- interface WorkflowBindingOptions {
549
- /** The name of the Worker that defines the Workflow. */
550
- worker: string;
551
- /** The exported class name of the Workflow. */
552
- exportName: string;
553
- }
568
+ type Trigger = ConnectTrigger | EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
554
569
  /**
555
- * Binding to a Workflow. `worker` is the name of the Worker that defines
556
- * the Workflow; `exportName` is the exported `WorkflowEntrypoint` class name.
570
+ * Union of all export definitions accepted in `exports`. Worker entries
571
+ * configure WorkerEntrypoint exports. Durable Object entries configure live
572
+ * classes and tombstone lifecycle operations.
557
573
  */
558
- interface WorkflowBinding extends WorkflowBindingOptions {
559
- type: "workflow";
560
- }
574
+ type Export = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport | WorkerEntrypointExport;
561
575
  /**
562
- * Binding to a Workflow. `worker` is the name of the Worker that defines
563
- * the Workflow; `exportName` is the exported `WorkflowEntrypoint` class name.
576
+ * Worker configuration. This is the input shape passed to
577
+ * [`defineWorker`](https://developers.cloudflare.com/workers/wrangler/configuration/).
578
+ *
579
+ * Fields are validated at runtime by `InputWorkerSchema` and normalised before
580
+ * being passed to downstream tooling.
564
581
  */
565
- interface TypedWorkflowBinding<TConfig$1, TExportName$1 extends string> extends WorkflowBinding {
566
- worker: string;
567
- exportName: TExportName$1;
568
- /** @internal Carries the config type for inference */
569
- __config: TConfig$1;
570
- }
571
- interface Bindings {
572
- /**
573
- * Agent Memory namespace binding. Each binding is scoped to a namespace and
574
- * allows agents to persist and recall memory.
575
- */
576
- agentMemory(options: AgentMemoryBindingOptions): AgentMemoryBinding;
582
+ interface WorkerConfig {
577
583
  /**
578
- * Binding to the Workers AI project.
584
+ * Discriminates this config as a Worker config.
579
585
  *
580
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
586
+ * Injected automatically by `defineWorker`; only needs to be written by
587
+ * hand when authoring a raw config object without the helper.
581
588
  */
582
- ai<TAiModelList extends AiModelListType = AiModels>(options?: AiBindingOptions): TypedAiBinding<TAiModelList>;
589
+ type: "worker";
583
590
  /**
584
- * AI Search instance binding. Each binding is bound directly to a single
585
- * pre-existing instance within the "default" namespace.
591
+ * The name of your Worker.
586
592
  */
587
- aiSearch(options: AiSearchBindingOptions): AiSearchBinding;
593
+ name: string;
588
594
  /**
589
- * AI Search namespace binding. Each binding is scoped to a namespace and
590
- * allows dynamic instance CRUD within it.
595
+ * A date in the form yyyy-mm-dd, which will be used to determine
596
+ * which version of the Workers runtime is used.
597
+ *
598
+ * More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
591
599
  */
592
- aiSearchNamespace(options: AiSearchNamespaceBindingOptions): AiSearchNamespaceBinding;
600
+ compatibilityDate: string;
593
601
  /**
594
- * Binding to an Analytics Engine dataset.
602
+ * A list of flags that enable features from upcoming features of
603
+ * the Workers runtime, usually used together with `compatibilityDate`.
595
604
  *
596
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
605
+ * More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
606
+ *
607
+ * @default []
597
608
  */
598
- analyticsEngineDataset(options?: AnalyticsEngineDatasetBindingOptions): AnalyticsEngineDatasetBinding;
609
+ compatibilityFlags?: string[];
599
610
  /**
600
- * Binding to an Artifacts instance. Artifacts provides git-compatible file
601
- * storage on Cloudflare Workers.
611
+ * The entrypoint module that will be executed.
612
+ *
613
+ * May be either a path string (e.g. `"./src/index.ts"`) or a module
614
+ * namespace imported with the `cf-worker` import attribute.
615
+ *
616
+ * @example
617
+ * ```ts
618
+ * import * as entrypoint from "./src" with { type: "cf-worker" };
619
+ * export default defineWorker({ entrypoint });
620
+ * ```
602
621
  */
603
- artifacts(options: ArtifactsBindingOptions): ArtifactsBinding;
622
+ entrypoint?: string | WorkerModule;
604
623
  /**
605
- * Binding to the Worker's static assets.
624
+ * Specify the directory of static assets to deploy/serve.
625
+ *
626
+ * More details at https://developers.cloudflare.com/workers/frameworks/
606
627
  *
607
628
  * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
608
629
  */
609
- assets(): AssetsBinding;
630
+ assets?: {
631
+ /** How to handle HTML requests. */
632
+ htmlHandling?: "auto-trailing-slash" | "drop-trailing-slash" | "force-trailing-slash" | "none";
633
+ /** How to handle requests that do not match an asset. */
634
+ notFoundHandling?: "single-page-application" | "404-page" | "none";
635
+ /**
636
+ * Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
637
+ *
638
+ * Can also be `true`, indicating that every request should be routed to the User Worker.
639
+ */
640
+ runWorkerFirst?: string[] | boolean;
641
+ };
610
642
  /**
611
- * Binding to a headless browser usable from the Worker.
643
+ * Custom domains that your Worker should be published to.
612
644
  *
613
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
645
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
614
646
  */
615
- browser(options?: BrowserBindingOptions): BrowserBinding;
647
+ domains?: string[];
616
648
  /**
617
- * Binding to a D1 database.
649
+ * Event triggers — fetch routes, queue consumers, cron schedules, Email
650
+ * Routing addresses, and raw sockets — that invoke this Worker.
651
+ * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
652
+ * `triggers.scheduled(...)`, `triggers.email(...)`, or
653
+ * `triggers.connect(...)`.
618
654
  *
619
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
655
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
620
656
  */
621
- d1(options?: D1BindingOptions): D1Binding;
657
+ triggers?: Trigger[];
622
658
  /**
623
- * Binding to a Workers for Platforms dispatch namespace.
659
+ * A list of Tail Workers that are bound to this Worker.
624
660
  *
625
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
661
+ * `@cloudflare/config` unifies regular and streaming tail consumers under
662
+ * a single field; pass `streaming: true` to forward streaming tail events.
663
+ *
664
+ * @default []
626
665
  */
627
- dispatchNamespace(options?: DispatchNamespaceBindingOptions): DispatchNamespaceBinding;
666
+ tailConsumers?: Array<{
667
+ /** The name of the service tail events will be forwarded to. */
668
+ worker: string;
669
+ /** Whether to stream tail events in real time. */
670
+ streaming?: boolean;
671
+ }>;
628
672
  /**
629
- * Binding to a Durable Object class. `worker` is the name of the Worker
630
- * that defines the class; `exportName` is the exported class name.
631
- *
632
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
673
+ * Specify the cache behavior of the Worker.
633
674
  */
634
- durableObject(options: DurableObjectBindingOptions): DurableObjectBinding;
635
- /** Binding to a Flagship feature-flag service. */
636
- flagship(options?: FlagshipBindingOptions): FlagshipBinding;
675
+ cache?: {
676
+ /** If cache is enabled for this Worker. */
677
+ enabled: boolean;
678
+ /** Whether cached assets may be reused across Worker versions. */
679
+ crossVersionCache?: boolean;
680
+ };
637
681
  /**
638
- * Binding to a Hyperdrive configuration.
682
+ * Specify how the Worker should be located to minimize round-trip time.
639
683
  *
640
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
684
+ * More details: https://developers.cloudflare.com/workers/platform/smart-placement/
641
685
  */
642
- hyperdrive(options: HyperdriveBindingOptions): HyperdriveBinding;
686
+ placement?: {
687
+ mode: "off" | "smart";
688
+ hint?: string;
689
+ } | {
690
+ mode?: "targeted";
691
+ region: string;
692
+ } | {
693
+ mode?: "targeted";
694
+ host: string;
695
+ } | {
696
+ mode?: "targeted";
697
+ hostname: string;
698
+ };
643
699
  /**
644
- * Binding to Cloudflare Images.
700
+ * Specify limits for runtime behavior.
701
+ * Only supported for the "standard" Usage Model.
645
702
  *
646
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
703
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
647
704
  */
648
- images(options?: ImagesBindingOptions): ImagesBinding$1;
649
- /**
650
- * Inline JSON value made available to the Worker on `env` under the
651
- * binding name.
652
- */
653
- json<T$1 extends Json>(value: T$1): JsonBinding<T$1>;
654
- /**
655
- * Binding to a Workers KV namespace.
656
- *
657
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
658
- */
659
- kv<TKey extends string = string>(options?: KvBindingOptions): TypedKvBinding<TKey>;
660
- /** Binding for forwarding logs to logfwdr. */
661
- logfwdr(options: LogfwdrBindingOptions): LogfwdrBinding;
662
- /** Binding to Cloudflare Media Transformations. */
663
- media(options?: MediaBindingOptions): MediaBinding$1;
705
+ limits?: {
706
+ /** Maximum allowed CPU time for a Worker's invocation in milliseconds. */
707
+ cpuMs?: number;
708
+ /** Maximum allowed number of fetch requests that a Worker's invocation can execute. */
709
+ subrequests?: number;
710
+ };
664
711
  /**
665
- * Binding to an uploaded mTLS certificate.
712
+ * Send Trace Events from this Worker to Workers Logpush.
666
713
  *
667
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
668
- */
669
- mtlsCertificate(options: MtlsCertificateBindingOptions): MtlsCertificateBinding;
670
- /** Binding to a Cloudflare Pipeline. */
671
- pipeline<TRecord extends PipelineRecord = PipelineRecord>(options: PipelineBindingOptions): TypedPipelineBinding<TRecord>;
672
- /**
673
- * Producer binding to a Cloudflare Queue.
714
+ * This will not configure a corresponding Logpush job automatically.
674
715
  *
675
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
716
+ * For more information about Workers Logpush, see:
717
+ * https://blog.cloudflare.com/logpush-for-workers/
676
718
  */
677
- queue<TBody = unknown>(options?: QueueBindingOptions): TypedQueueBinding<TBody>;
719
+ logpush?: boolean;
678
720
  /**
679
- * Binding to an R2 bucket.
721
+ * Specify the observability behavior of the Worker.
680
722
  *
681
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
723
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
682
724
  */
683
- r2(options?: R2BindingOptions): R2Binding;
684
- /** Binding to a rate limiter. */
685
- rateLimit(options: RateLimitBindingOptions): RateLimitBinding;
725
+ observability?: {
726
+ /** If observability is enabled for this Worker. */
727
+ enabled?: boolean;
728
+ /** The sampling rate. */
729
+ headSamplingRate?: number;
730
+ /**
731
+ * Whether query strings are removed from request URLs in logs and traces.
732
+ *
733
+ * @default false
734
+ */
735
+ redactQueryString?: boolean;
736
+ logs?: {
737
+ enabled?: boolean;
738
+ /** The sampling rate. */
739
+ headSamplingRate?: number;
740
+ /** Set to false to disable invocation logs. */
741
+ invocationLogs?: boolean;
742
+ /**
743
+ * If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
744
+ *
745
+ * @default true
746
+ */
747
+ persist?: boolean;
748
+ /**
749
+ * What destinations logs emitted from the Worker should be sent to.
750
+ *
751
+ * @default []
752
+ */
753
+ destinations?: string[];
754
+ };
755
+ traces?: {
756
+ enabled?: boolean;
757
+ /** The sampling rate. */
758
+ headSamplingRate?: number;
759
+ /**
760
+ * If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
761
+ *
762
+ * @default true
763
+ */
764
+ persist?: boolean;
765
+ /**
766
+ * What destinations traces emitted from the Worker should be sent to.
767
+ *
768
+ * @default []
769
+ */
770
+ destinations?: string[];
771
+ };
772
+ };
686
773
  /**
687
- * Declares a secret that is required by your Worker, exposed on `env` under
688
- * the binding name.
774
+ * Whether we use `<name>.<subdomain>.workers.dev` to
775
+ * test and deploy your Worker.
689
776
  *
690
- * When defined, this binding:
691
- * - Replaces .dev.vars/.env/process.env inference for type generation
692
- * - Enables local dev validation with warnings for missing secrets
777
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
693
778
  *
694
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
779
+ * @default true
695
780
  */
696
- secret(): SecretBinding;
697
- /** Binding to a Secrets Store secret. */
698
- secretsStoreSecret(options: SecretsStoreSecretBindingOptions): SecretsStoreSecretBinding;
781
+ workersDev?: boolean;
699
782
  /**
700
- * Binding for sending email from inside the Worker.
783
+ * Whether we use `<version>-<name>.<subdomain>.workers.dev` to
784
+ * serve Preview URLs for your Worker.
701
785
  *
702
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
786
+ * @default false
703
787
  */
704
- sendEmail(options?: SendEmailBindingOptions): SendEmailBinding;
705
- /** Binding to Cloudflare Stream. */
706
- stream(options?: StreamBindingOptions): StreamBinding$1;
788
+ previewUrls?: boolean;
707
789
  /**
708
- * Inline string value made available to the Worker on `env` under the
709
- * binding name.
790
+ * Designates this Worker as an internal-only "first-party" Worker.
710
791
  *
711
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
792
+ * @internal
712
793
  */
713
- text<T$1 extends string>(value: T$1): TextBinding<T$1>;
794
+ firstPartyWorker?: boolean;
714
795
  /**
715
- * Binding to a Vectorize index.
796
+ * "Unsafe" tables for runtime features that aren't directly supported by
797
+ * this configuration. Values are forwarded verbatim in the Worker's
798
+ * upload metadata.
716
799
  *
717
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
800
+ * @default {}
718
801
  */
719
- vectorize(options: VectorizeBindingOptions): VectorizeBinding;
720
- /** Binding to the Worker version's metadata. */
721
- versionMetadata(): VersionMetadataBinding;
722
- /** Binding to a VPC network. */
723
- vpcNetwork(options: VpcNetworkBindingOptions): VpcNetworkBinding;
724
- /** Binding to a VPC service. */
725
- vpcService(options: VpcServiceBindingOptions): VpcServiceBinding;
802
+ unsafe?: {
803
+ /**
804
+ * Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
805
+ * here will always be applied to metadata last, so can add new or override existing fields.
806
+ */
807
+ metadata?: Record<string, unknown>;
808
+ /**
809
+ * Used for internal capnp uploads for the Workers runtime.
810
+ */
811
+ capnp?: {
812
+ basePath: string;
813
+ sourceSchemas: string[];
814
+ compiledSchema?: never;
815
+ } | {
816
+ basePath?: never;
817
+ sourceSchemas?: never;
818
+ compiledSchema: string;
819
+ };
820
+ };
726
821
  /**
727
- * Cloudflare Web Search binding. There is exactly one shared web corpus, so
728
- * the binding is zero-config — only the variable name is required.
822
+ * Bindings exposed on the Worker's `env` object. Construct entries with
823
+ * `bindings.kv(...)`, `bindings.r2(...)`, etc.
729
824
  */
730
- webSearch(options?: WebSearchBindingOptions): WebSearchBinding;
825
+ env?: Record<string, Binding>;
731
826
  /**
732
- * Service binding (Worker-to-Worker). `worker` is the name of the bound
733
- * Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
734
- * the default export).
827
+ * Configuration for named exports declared by the Worker. Each entry's
828
+ * key is the exported class name; the value configures the export.
735
829
  *
736
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
830
+ * Only one export kind is currently supported:
831
+ *
832
+ * - Construct entries with `exports.durableObject(...)`.
833
+ * - Declares Durable Object classes exported from this Worker.
834
+ * For more information about Durable Objects, see the documentation at
835
+ * https://developers.cloudflare.com/workers/learning/using-durable-objects.
836
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects.
737
837
  */
738
- worker(options: WorkerBindingOptions): WorkerBinding;
739
- /** Binding to a Worker Loader. */
740
- workerLoader(): WorkerLoaderBinding;
838
+ exports?: Record<string, Export>;
741
839
  }
742
- declare const bindings: Bindings;
743
- //#endregion
744
- //#region src/triggers.d.ts
745
- interface FetchTriggerOptions {
840
+ /**
841
+ * Settings shared by the other exports.
842
+ * Authored as a named `settings` export via
843
+ * `defineSettings`.
844
+ */
845
+ interface SettingsConfig {
746
846
  /**
747
- * A route that your Worker should be published to.
847
+ * Discriminates this config as a settings config.
748
848
  *
749
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
849
+ * Injected automatically by `defineSettings`; only needs to be written by
850
+ * hand when authoring a raw config object without the helper.
750
851
  */
751
- pattern: string;
852
+ type: "settings";
752
853
  /**
753
- * The DNS zone the pattern is attached to. Required when the
754
- * pattern is ambiguous.
854
+ * This is the ID of the account associated with your zone.
855
+ * You might have more than one account, so make sure to use
856
+ * the ID of the account associated with the zone/route you
857
+ * provide, if you provide one. It can also be specified through
858
+ * the CLOUDFLARE_ACCOUNT_ID environment variable.
755
859
  */
756
- zone?: string;
860
+ accountId?: string;
861
+ /**
862
+ * Specify the compliance region mode of the Worker.
863
+ *
864
+ * Although if the user does not specify a compliance region, the default is `public`,
865
+ * it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
866
+ */
867
+ complianceRegion?: "public" | "fedramp-high";
757
868
  }
869
+ //#endregion
870
+ //#region src/worker-definition.d.ts
871
+ type WorkerConfigExport<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
758
872
  /**
759
- * Fetch trigger — a route that your Worker should be published to.
760
- *
761
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
873
+ * Authored Worker config shape — {@link WorkerConfig} without the `type`
874
+ * discriminant, which `defineWorker` injects.
762
875
  */
763
- interface FetchTrigger extends FetchTriggerOptions {
764
- type: "fetch";
876
+ type WorkerConfigInput = Omit<WorkerConfig, "type">;
877
+ declare const defineWorker: <const TInput extends ConfigInput<WorkerConfigInput>>(config: TInput) => TInput extends ((ctx: ConfigContext) => infer TResult) ? (ctx: ConfigContext) => TResult extends Promise<infer TConfig extends {
878
+ [x: string]: unknown;
879
+ }> ? Promise<ConfigWithType<TConfig, "worker">> : TResult extends {
880
+ [x: string]: unknown;
881
+ } ? ConfigWithType<TResult, "worker"> : never : TInput extends Promise<infer TConfig extends {
882
+ [x: string]: unknown;
883
+ }> ? Promise<ConfigWithType<TConfig, "worker">> : TInput extends {
884
+ [x: string]: unknown;
885
+ } ? ConfigWithType<TInput, "worker"> : never;
886
+ //#endregion
887
+ //#region src/bindings.d.ts
888
+ /** Options that control a binding during local development. */
889
+ interface BindingDevOptions {
890
+ /** Whether the binding should connect to the remote resource. */
891
+ remote?: boolean;
765
892
  }
766
- interface QueueConsumerTriggerOptions {
767
- /** The name of the queue from which this consumer should consume. */
768
- name: string;
769
- /** The queue to send messages that failed to be consumed. */
770
- deadLetterQueue?: string;
771
- /** The maximum number of messages per batch. */
772
- maxBatchSize?: number;
773
- /** The maximum number of seconds to wait to fill a batch with messages. */
774
- maxBatchTimeout?: number;
775
- /**
776
- * The maximum number of concurrent consumer Worker invocations.
777
- * Leaving this unset will allow your consumer to scale to the
778
- * maximum concurrency needed to keep up with the message backlog.
779
- */
780
- maxConcurrency?: number | null;
781
- /** The maximum number of retries for each message. */
782
- maxRetries?: number;
783
- /** The number of seconds to wait before retrying a message. */
784
- retryDelay?: number;
785
- /** The number of milliseconds to wait for pulled messages to become visible again. */
786
- visibilityTimeoutMs?: number;
893
+ interface AgentMemoryBindingOptions {
894
+ /** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
895
+ namespace: string;
896
+ /** Options that only apply during local development. */
897
+ dev?: BindingDevOptions;
787
898
  }
788
899
  /**
789
- * Queue consumer trigger — invokes this Worker when messages arrive on the
790
- * named queue.
791
- *
792
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
900
+ * Agent Memory namespace binding. Each binding is scoped to a namespace and
901
+ * allows agents to persist and recall memory.
793
902
  */
794
- interface QueueConsumerTrigger extends QueueConsumerTriggerOptions {
795
- type: "queue";
903
+ interface AgentMemoryBinding extends AgentMemoryBindingOptions {
904
+ type: "agent-memory";
796
905
  }
797
- interface ScheduledTriggerOptions {
798
- /**
799
- * A "cron" definition to trigger a Worker's "scheduled" function.
800
- *
801
- * Lets you call Workers periodically, much like a cron job.
802
- *
803
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
804
- */
805
- schedule: string;
906
+ interface AiBindingOptions {
907
+ /** Options that only apply during local development. */
908
+ dev?: BindingDevOptions;
806
909
  }
807
910
  /**
808
- * Scheduled (cron) trigger — invokes this Worker on the given schedules.
911
+ * Binding to the Workers AI project.
809
912
  *
810
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
913
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
811
914
  */
812
- interface ScheduledTrigger extends ScheduledTriggerOptions {
813
- type: "scheduled";
814
- }
815
- interface EmailTriggerOptions {
816
- /**
817
- * Inbound Email Routing addresses handled by this Worker.
818
- *
819
- * Each entry is a literal recipient address (e.g. `"support@example.com"`)
820
- * or a `*@domain` catch-all (e.g. `"*@example.com"`).
821
- */
822
- addresses: string[];
915
+ interface AiBinding extends AiBindingOptions {
916
+ type: "ai";
823
917
  }
824
918
  /**
825
- * Email trigger — invokes this Worker for the configured Email Routing
826
- * addresses.
919
+ * Binding to the Workers AI project.
920
+ *
921
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
827
922
  */
828
- interface EmailTrigger extends EmailTriggerOptions {
829
- type: "email";
923
+ interface TypedAiBinding<TAiModelList extends AiModelListType = AiModels> extends AiBinding {
924
+ /** @internal Carries type parameters for inference */
925
+ __typeParams: [TAiModelList];
830
926
  }
831
- interface ConnectTriggerOptions {
832
- /** The transport protocol to listen for. */
833
- protocol: "tcp";
834
- /** The port to listen on. */
835
- port: number;
836
- /** The address to bind to. Defaults to `127.0.0.1`. */
837
- address?: string;
927
+ interface AiSearchBindingOptions {
928
+ /** The user-chosen instance name. Must exist in Cloudflare at deploy time. */
929
+ name: string;
930
+ /** Options that only apply during local development. */
931
+ dev?: BindingDevOptions;
838
932
  }
839
933
  /**
840
- * Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
841
- * handler for raw socket connections received on the configured
842
- * protocol/port.
934
+ * AI Search instance binding. Each binding is bound directly to a single
935
+ * pre-existing instance within the "default" namespace.
843
936
  */
844
- interface ConnectTrigger extends ConnectTriggerOptions {
845
- type: "connect";
937
+ interface AiSearchBinding extends AiSearchBindingOptions {
938
+ type: "ai-search";
939
+ }
940
+ interface AiSearchNamespaceBindingOptions {
941
+ /** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
942
+ namespace: string;
943
+ /** Options that only apply during local development. */
944
+ dev?: BindingDevOptions;
846
945
  }
847
946
  /**
848
- * Event triggers — fetch routes, queue consumers, cron schedules, Email
849
- * Routing addresses, and raw sockets — that invoke this Worker.
850
- * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
851
- * `triggers.scheduled(...)`, `triggers.email(...)`, or `triggers.connect(...)`.
852
- *
853
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
947
+ * AI Search namespace binding. Each binding is scoped to a namespace and
948
+ * allows dynamic instance CRUD within it.
854
949
  */
855
- interface Triggers {
856
- /**
857
- * Fetch trigger — a route that your Worker should be published to.
858
- *
859
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
860
- */
861
- fetch(options: FetchTriggerOptions): FetchTrigger;
862
- /**
863
- * Queue consumer trigger — invokes this Worker when messages arrive on the
864
- * named queue.
865
- *
866
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
867
- */
868
- queue(options: QueueConsumerTriggerOptions): QueueConsumerTrigger;
869
- /**
870
- * Scheduled (cron) trigger — invokes this Worker on the given schedules.
871
- *
872
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
873
- */
874
- scheduled(options: ScheduledTriggerOptions): ScheduledTrigger;
875
- /**
876
- * Email trigger — invokes this Worker for the configured Email Routing
877
- * addresses.
878
- */
879
- email(options: EmailTriggerOptions): EmailTrigger;
880
- /**
881
- * Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
882
- * handler for raw socket connections received on the configured
883
- * protocol/port.
884
- */
885
- connect(options: ConnectTriggerOptions): ConnectTrigger;
950
+ interface AiSearchNamespaceBinding extends AiSearchNamespaceBindingOptions {
951
+ type: "ai-search-namespace";
952
+ }
953
+ interface AnalyticsEngineDatasetBindingOptions {
954
+ /** The name of this dataset to write to. */
955
+ name?: string;
886
956
  }
887
957
  /**
888
- * Triggers builder for configuring event triggers.
889
- *
890
- * @example
891
- * ```typescript
892
- * import { defineWorker, triggers } from "@cloudflare/config";
958
+ * Binding to an Analytics Engine dataset.
893
959
  *
894
- * export default defineWorker({
895
- * triggers: [
896
- * triggers.fetch({ pattern: "example.com/*", zone: "example.com" }),
897
- * triggers.queue({ name: "my-queue" }),
898
- * triggers.scheduled({ schedule: "0 * * * *" }),
899
- * triggers.scheduled({ schedule: "30 0 * * *" }),
900
- * triggers.email({ addresses: ["support@example.com"] }),
901
- * triggers.connect({ protocol: "tcp", port: 5432 }),
902
- * ],
903
- * });
904
- * ```
960
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
905
961
  */
906
- declare const triggers: Triggers;
907
- //#endregion
908
- //#region src/exports.d.ts
962
+ interface AnalyticsEngineDatasetBinding extends AnalyticsEngineDatasetBindingOptions {
963
+ type: "analytics-engine-dataset";
964
+ }
965
+ interface ArtifactsBindingOptions {
966
+ /** The namespace to use. */
967
+ namespace: string;
968
+ /** Options that only apply during local development. */
969
+ dev?: BindingDevOptions;
970
+ }
909
971
  /**
910
- * Storage backend for the Durable Object.
911
- *
912
- * Containers are only supported on the SQLite storage engine, so `container` is
913
- * only offered alongside `storage: "sqlite"`.
972
+ * Binding to an Artifacts instance. Artifacts provides git-compatible file
973
+ * storage on Cloudflare Workers.
914
974
  */
915
- type DurableObjectStorageOptions = {
916
- /**
917
- * Selects the SQLite-backed storage engine (recommended for new
918
- * classes).
919
- */
920
- storage: "sqlite";
921
- /**
922
- * Attach a container to this Durable Object, by container name. The
923
- * name must match an entry in the top level `containers` array.
924
- */
925
- container?: string;
926
- } | {
927
- /** Selects the legacy key-value storage engine. */
928
- storage: "legacy-kv";
929
- };
975
+ interface ArtifactsBinding extends ArtifactsBindingOptions {
976
+ type: "artifacts";
977
+ }
930
978
  /**
931
- * Declares a provisioned Durable Object class exported from this Worker.
932
- *
933
- * For more information about Durable Objects, see the documentation at
934
- * https://developers.cloudflare.com/workers/learning/using-durable-objects
979
+ * Binding to the Worker's static assets.
935
980
  *
936
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
981
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
937
982
  */
938
- type DurableObjectCreatedExportOptions = {
939
- state?: "created";
940
- } & DurableObjectStorageOptions;
983
+ interface AssetsBinding {
984
+ type: "assets";
985
+ }
986
+ interface BrowserBindingOptions {
987
+ /** Options that only apply during local development. */
988
+ dev?: BindingDevOptions;
989
+ }
941
990
  /**
942
- * Retire a provisioned Durable Object namespace whose class has
943
- * been removed from code.
991
+ * Binding to a headless browser usable from the Worker.
944
992
  *
945
- * During deploy, the class must not be exported in the uploaded code, and no
946
- * other Worker may hold a `durableObject` binding to the namespace.
993
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
947
994
  */
948
- interface DurableObjectDeletedExportOptions {
949
- state: "deleted";
995
+ interface BrowserBinding extends BrowserBindingOptions {
996
+ type: "browser";
997
+ }
998
+ interface D1BindingOptions {
999
+ /** The UUID of this D1 database (not required). */
1000
+ id?: string;
1001
+ /** The name of this D1 database. */
1002
+ name?: string;
1003
+ /** Options that only apply during local development. */
1004
+ dev?: BindingDevOptions;
950
1005
  }
951
1006
  /**
952
- * Rename a provisioned Durable Object namespace's class. The
953
- * `renamedTo` value must also appear as a live (`state: "created"`)
954
- * `durableObject` entry in the same `exports` map.
1007
+ * Binding to a D1 database.
1008
+ *
1009
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
955
1010
  */
956
- interface DurableObjectRenamedExportOptions {
957
- state: "renamed";
958
- /**
959
- * The destination class name. Must be a valid JavaScript identifier and
960
- * must appear as a live (`state: "created"`) `durableObject` entry in the
961
- * same `exports` map.
962
- */
963
- renamedTo: string;
1011
+ interface D1Binding extends D1BindingOptions {
1012
+ type: "d1";
1013
+ }
1014
+ interface DispatchNamespaceBindingOptions {
1015
+ /** The namespace to bind to. */
1016
+ namespace?: string;
1017
+ /** Details about the outbound Worker which will handle outbound requests from your namespace. */
1018
+ outbound?: {
1019
+ /** Name of the Worker handling the outbound requests. */
1020
+ worker: string;
1021
+ /** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler. */
1022
+ parameters?: string[];
1023
+ };
1024
+ /** Options that only apply during local development. */
1025
+ dev?: BindingDevOptions;
964
1026
  }
965
1027
  /**
966
- * Transfer ownership of a Durable Object namespace to another Worker in the same account.
967
- * The target Worker must first deploy an `expectingTransfer` entry naming this Worker via `transferFrom`.
1028
+ * Binding to a Workers for Platforms dispatch namespace.
1029
+ *
1030
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
968
1031
  */
969
- interface DurableObjectTransferredExportOptions {
970
- state: "transferred";
971
- /**
972
- * The destination Worker. Must reference a Worker in the same account.
973
- */
974
- transferredTo: string;
1032
+ interface DispatchNamespaceBinding extends DispatchNamespaceBindingOptions {
1033
+ type: "dispatch-namespace";
1034
+ }
1035
+ type WorkerReference = string | WorkerConfigExport;
1036
+ type ReferencedWorkerConfig<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? never : UnwrapConfig<TWorker$1>;
1037
+ type DurableObjectExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferDurableNamespaces<ReferencedWorkerConfig<TWorker$1>>;
1038
+ type WorkerEntrypointExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferWorkerEntrypointExports<ReferencedWorkerConfig<TWorker$1>>;
1039
+ type WorkflowExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferExportsByType<ReferencedWorkerConfig<TWorker$1>, "workflow">;
1040
+ interface DurableObjectBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1> = DurableObjectExportName<TWorker$1>> {
1041
+ /** The name or config of the Worker that defines the Durable Object class. */
1042
+ worker: TWorker$1;
1043
+ /** The exported class name of the Durable Object. */
1044
+ exportName: TExportName$1;
975
1045
  }
976
1046
  /**
977
- * Prepare to receive cross-Worker Durable Object transfer.
978
- * Once the source Worker's `transferred` export is deployed, this entry becomes a normal live `durable-object` export.
1047
+ * Binding to a Durable Object class. `worker` is the name or config of the
1048
+ * Worker that defines the class; `exportName` is the exported class name.
1049
+ *
1050
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
979
1051
  */
980
- type DurableObjectExpectingTransferExportOptions = {
981
- state: "expecting-transfer";
982
- /**
983
- * The source Worker for the two-phase cross-Worker transfer.
984
- */
985
- transferFrom: string;
986
- } & DurableObjectStorageOptions;
987
- type DurableObjectCreatedExport = DurableObjectCreatedExportOptions & {
988
- type: "durable-object";
989
- };
990
- interface DurableObjectDeletedExport extends DurableObjectDeletedExportOptions {
1052
+ interface DurableObjectBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1> = DurableObjectExportName<TWorker$1>> extends DurableObjectBindingOptions<TWorker$1, TExportName$1> {
991
1053
  type: "durable-object";
992
1054
  }
993
- interface DurableObjectRenamedExport extends DurableObjectRenamedExportOptions {
994
- type: "durable-object";
1055
+ interface FlagshipBindingOptions {
1056
+ /** The Flagship app ID to bind to. */
1057
+ id?: string;
1058
+ /** Options that only apply during local development. */
1059
+ dev?: BindingDevOptions;
995
1060
  }
996
- interface DurableObjectTransferredExport extends DurableObjectTransferredExportOptions {
997
- type: "durable-object";
1061
+ /** Binding to a Flagship feature-flag service. */
1062
+ interface FlagshipBinding extends FlagshipBindingOptions {
1063
+ type: "flagship";
998
1064
  }
999
- type DurableObjectExpectingTransferExport = DurableObjectExpectingTransferExportOptions & {
1000
- type: "durable-object";
1001
- };
1002
- type DurableObjectExportOptions = DurableObjectCreatedExportOptions | DurableObjectDeletedExportOptions | DurableObjectRenamedExportOptions | DurableObjectTransferredExportOptions | DurableObjectExpectingTransferExportOptions;
1003
- type DurableObjectExports = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport;
1004
- interface WorkerEntrypointExportOptions {
1005
- cache?: {
1006
- /** Whether cache is enabled for this entrypoint. */
1007
- enabled: boolean;
1065
+ interface HyperdriveBindingOptions {
1066
+ /** The ID of the Hyperdrive configuration. */
1067
+ id: string;
1068
+ /** Options that only apply during local development. */
1069
+ dev?: {
1070
+ /** The database connection string used during local development. */
1071
+ connectionString?: string;
1008
1072
  };
1009
1073
  }
1010
- interface WorkerEntrypointExport extends WorkerEntrypointExportOptions {
1011
- type: "worker";
1012
- }
1013
1074
  /**
1014
- * Configuration for named exports declared by the Worker. Each entry's
1015
- * key is the exported class name; the value configures the export.
1075
+ * Binding to a Hyperdrive configuration.
1076
+ *
1077
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
1016
1078
  */
1017
- interface Exports {
1018
- /**
1019
- * Declares a Durable Object class defined by this Worker.
1020
- *
1021
- * For more information about Durable Objects, see the documentation at
1022
- * https://developers.cloudflare.com/workers/learning/using-durable-objects
1023
- *
1024
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1025
- */
1026
- durableObject(options: DurableObjectCreatedExportOptions): DurableObjectCreatedExport;
1027
- /**
1028
- * Retire a provisioned Durable Object namespace whose class has been removed from code.
1029
- */
1030
- durableObject(options: DurableObjectDeletedExportOptions): DurableObjectDeletedExport;
1031
- /**
1032
- * Rename a provisioned Durable Object namespace's class.
1033
- */
1034
- durableObject(options: DurableObjectRenamedExportOptions): DurableObjectRenamedExport;
1035
- /**
1036
- * Transfer ownership of a Durable Object namespace to another Worker in the same account.
1037
- */
1038
- durableObject(options: DurableObjectTransferredExportOptions): DurableObjectTransferredExport;
1039
- /**
1040
- * Prepare to receive cross-Worker Durable Object transfer.
1041
- * The source Worker must follow up with a deployment containing a `transferred` export to commit the transfer.
1042
- */
1043
- durableObject(options: DurableObjectExpectingTransferExportOptions): DurableObjectExpectingTransferExport;
1044
- durableObject(options: DurableObjectExportOptions): DurableObjectExports;
1045
- /** Declares a WorkerEntrypoint export defined by this Worker. */
1046
- worker(options?: WorkerEntrypointExportOptions): WorkerEntrypointExport;
1079
+ interface HyperdriveBinding extends HyperdriveBindingOptions {
1080
+ type: "hyperdrive";
1081
+ }
1082
+ interface ImagesBindingOptions {
1083
+ /** Options that only apply during local development. */
1084
+ dev?: BindingDevOptions;
1047
1085
  }
1048
1086
  /**
1049
- * Exports builder for configuring Worker exports.
1050
- *
1051
- * @example
1052
- * ```typescript
1053
- * import { defineWorker, exports } from "@cloudflare/config";
1087
+ * Binding to Cloudflare Images.
1054
1088
  *
1055
- * export default defineWorker({
1056
- * exports: {
1057
- * MyDurableObject: exports.durableObject({ storage: "sqlite" }),
1058
- * MyContainerDO: exports.durableObject({ storage: "sqlite", container: "my-container" }),
1059
- * OldClass: exports.durableObject({ state: "deleted" }),
1060
- * OldName: exports.durableObject({ state: "renamed", renamedTo: "NewName" }),
1061
- * Outgoing: exports.durableObject({ state: "transferred", transferredTo: "target-worker" }),
1062
- * Incoming: exports.durableObject({ state: "expecting-transfer", storage: "sqlite", transferFrom: "source-worker" }),
1063
- * },
1064
- * });
1065
- * ```
1089
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
1066
1090
  */
1067
- declare const exports: Exports;
1068
- //#endregion
1069
- //#region src/definition.d.ts
1070
- interface ConfigContext {
1071
- /**
1072
- * The mode the config is being evaluated in.
1073
- * Set via the `--mode` CLI flag.
1074
- * In Vite the mode defaults to `development` in `vite dev` and `production` in `vite build` ([more info](https://vite.dev/guide/env-and-mode.html#modes)).
1075
- * In Wrangler the mode defaults to `undefined`.
1076
- */
1077
- mode: string | undefined;
1091
+ interface ImagesBinding$1 extends ImagesBindingOptions {
1092
+ type: "images";
1078
1093
  }
1079
- declare const DEFINITION: unique symbol;
1080
1094
  /**
1081
- * The authored config in any of its supported shapes: a plain value, a promise,
1082
- * or a function of {@link ConfigContext}.
1095
+ * Inline JSON value made available to the Worker on `env` under the
1096
+ * binding name.
1083
1097
  */
1084
- type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
1098
+ interface JsonBinding<T$1 extends Json = Json> {
1099
+ type: "json";
1100
+ /** The JSON value made available to the Worker. */
1101
+ value: T$1;
1102
+ }
1103
+ interface KvBindingOptions {
1104
+ /** The ID of the KV namespace. */
1105
+ id?: string;
1106
+ /** Options that only apply during local development. */
1107
+ dev?: BindingDevOptions;
1108
+ }
1085
1109
  /**
1086
- * Resolve any `cloudflare.config.ts` export to its plain config value.
1110
+ * Binding to a Workers KV namespace.
1087
1111
  *
1088
- * A `define*` helper stores its authored config plus `type` under the
1089
- * {@link DEFINITION} symbol; here we unwrap the config and stamp `type` back on.
1090
- * Every other export — a raw object/promise/function — is unwrapped as-is and
1091
- * already carries its own `type`. Discrimination happens afterwards via `type`.
1112
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
1092
1113
  */
1093
-
1094
- //#endregion
1095
- //#region src/types.d.ts
1114
+ interface KvBinding extends KvBindingOptions {
1115
+ type: "kv";
1116
+ }
1096
1117
  /**
1097
- * Union of all binding definitions accepted in `env`.
1118
+ * Binding to a Workers KV namespace.
1119
+ *
1120
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
1098
1121
  */
1099
- type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamespaceBinding | AnalyticsEngineDatasetBinding | ArtifactsBinding | AssetsBinding | BrowserBinding | D1Binding | DispatchNamespaceBinding | DurableObjectBinding | FlagshipBinding | HyperdriveBinding | ImagesBinding$1 | JsonBinding | KvBinding | LogfwdrBinding | MediaBinding$1 | MtlsCertificateBinding | PipelineBinding | QueueBinding | R2Binding | RateLimitBinding | SecretBinding | SecretsStoreSecretBinding | SendEmailBinding | StreamBinding$1 | TextBinding | UnsafeBinding | VectorizeBinding | VersionMetadataBinding | VpcNetworkBinding | VpcServiceBinding | WebSearchBinding | WorkerBinding | WorkerLoaderBinding;
1122
+ interface TypedKvBinding<TKey extends string = string> extends KvBinding {
1123
+ /** @internal Carries type parameters for inference */
1124
+ __typeParams: [TKey];
1125
+ }
1126
+ interface LogfwdrBindingOptions {
1127
+ /** The destination for this logged message. */
1128
+ destination: string;
1129
+ }
1130
+ /** Binding for forwarding logs to logfwdr. */
1131
+ interface LogfwdrBinding extends LogfwdrBindingOptions {
1132
+ type: "logfwdr";
1133
+ }
1134
+ interface MediaBindingOptions {
1135
+ /** Options that only apply during local development. */
1136
+ dev?: BindingDevOptions;
1137
+ }
1138
+ /** Binding to Cloudflare Media Transformations. */
1139
+ interface MediaBinding$1 extends MediaBindingOptions {
1140
+ type: "media";
1141
+ }
1142
+ interface MtlsCertificateBindingOptions {
1143
+ /** The UUID of the uploaded mTLS certificate. */
1144
+ id: string;
1145
+ /** Options that only apply during local development. */
1146
+ dev?: BindingDevOptions;
1147
+ }
1100
1148
  /**
1101
- * Union of all trigger definitions accepted in `triggers`.
1149
+ * Binding to an uploaded mTLS certificate.
1150
+ *
1151
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
1102
1152
  */
1103
- type Trigger = ConnectTrigger | EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
1153
+ interface MtlsCertificateBinding extends MtlsCertificateBindingOptions {
1154
+ type: "mtls-certificate";
1155
+ }
1156
+ interface PipelineBindingOptions {
1157
+ /** Name of the Pipeline to bind. */
1158
+ name: string;
1159
+ /** Options that only apply during local development. */
1160
+ dev?: BindingDevOptions;
1161
+ }
1162
+ /** Binding to a Cloudflare Pipeline. */
1163
+ interface PipelineBinding extends PipelineBindingOptions {
1164
+ type: "pipeline";
1165
+ }
1166
+ /** Binding to a Cloudflare Pipeline. */
1167
+ interface TypedPipelineBinding<TRecord extends PipelineRecord = PipelineRecord> extends PipelineBinding {
1168
+ /** @internal Carries type parameters for inference */
1169
+ __typeParams: [TRecord];
1170
+ }
1171
+ interface QueueBindingOptions {
1172
+ /** The name of this Queue. */
1173
+ name?: string;
1174
+ /** The number of seconds to wait before delivering a message. */
1175
+ deliveryDelay?: number;
1176
+ /** Options that only apply during local development. */
1177
+ dev?: BindingDevOptions;
1178
+ }
1104
1179
  /**
1105
- * Union of all export definitions accepted in `exports`. Worker entries
1106
- * configure WorkerEntrypoint exports. Durable Object entries configure live
1107
- * classes and tombstone lifecycle operations.
1180
+ * Producer binding to a Cloudflare Queue.
1181
+ *
1182
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
1108
1183
  */
1109
- type Export = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport | WorkerEntrypointExport;
1184
+ interface QueueBinding extends QueueBindingOptions {
1185
+ type: "queue";
1186
+ }
1110
1187
  /**
1111
- * Worker configuration. This is the input shape passed to
1112
- * [`defineWorker`](https://developers.cloudflare.com/workers/wrangler/configuration/).
1188
+ * Producer binding to a Cloudflare Queue.
1113
1189
  *
1114
- * Fields are validated at runtime by `InputWorkerSchema` and normalised before
1115
- * being passed to downstream tooling.
1190
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
1116
1191
  */
1117
- interface WorkerConfig {
1118
- /**
1119
- * Discriminates this config as a Worker config.
1120
- *
1121
- * Injected automatically by `defineWorker`; only needs to be written by
1122
- * hand when authoring a raw config object without the helper.
1123
- */
1124
- type: "worker";
1125
- /**
1126
- * The name of your Worker.
1127
- */
1128
- name: string;
1129
- /**
1130
- * A date in the form yyyy-mm-dd, which will be used to determine
1131
- * which version of the Workers runtime is used.
1132
- *
1133
- * More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
1134
- */
1135
- compatibilityDate: string;
1136
- /**
1137
- * A list of flags that enable features from upcoming features of
1138
- * the Workers runtime, usually used together with `compatibilityDate`.
1139
- *
1140
- * More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
1141
- *
1142
- * @default []
1143
- */
1144
- compatibilityFlags?: string[];
1145
- /**
1146
- * The entrypoint module that will be executed.
1147
- *
1148
- * May be either a path string (e.g. `"./src/index.ts"`) or a module
1149
- * namespace imported with the `cf-worker` import attribute.
1150
- *
1151
- * @example
1152
- * ```ts
1153
- * import * as entrypoint from "./src" with { type: "cf-worker" };
1154
- * export default defineWorker({ entrypoint });
1155
- * ```
1156
- */
1157
- entrypoint?: string | WorkerModule;
1158
- /**
1159
- * Specify the directory of static assets to deploy/serve.
1160
- *
1161
- * More details at https://developers.cloudflare.com/workers/frameworks/
1162
- *
1163
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
1164
- */
1165
- assets?: {
1166
- /** How to handle HTML requests. */
1167
- htmlHandling?: "auto-trailing-slash" | "drop-trailing-slash" | "force-trailing-slash" | "none";
1168
- /** How to handle requests that do not match an asset. */
1169
- notFoundHandling?: "single-page-application" | "404-page" | "none";
1170
- /**
1171
- * Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
1172
- *
1173
- * Can also be `true`, indicating that every request should be routed to the User Worker.
1174
- */
1175
- runWorkerFirst?: string[] | boolean;
1192
+ interface TypedQueueBinding<TBody = unknown> extends QueueBinding {
1193
+ /** @internal Carries type parameters for inference */
1194
+ __typeParams: [TBody];
1195
+ }
1196
+ interface R2BindingOptions {
1197
+ /** The name of this R2 bucket at the edge. */
1198
+ name?: string;
1199
+ /** The jurisdiction that the bucket exists in. Default if not present. */
1200
+ jurisdiction?: string;
1201
+ /** Settings that only apply to local development. */
1202
+ dev?: BindingDevOptions & {
1203
+ /** EXPERIMENTAL: credentials for the local S3-compatible endpoint. */
1204
+ experimentalS3Credentials?: {
1205
+ accessKeyId: string;
1206
+ secretAccessKey: string;
1207
+ };
1176
1208
  };
1209
+ }
1210
+ /**
1211
+ * Binding to an R2 bucket.
1212
+ *
1213
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
1214
+ */
1215
+ interface R2Binding extends R2BindingOptions {
1216
+ type: "r2";
1217
+ }
1218
+ interface RateLimitBindingOptions {
1219
+ /** The namespace ID for this rate limiter. */
1220
+ namespace: string;
1221
+ /** Simple rate limiting configuration. */
1222
+ simple: {
1223
+ /** The maximum number of requests allowed in the time period. */
1224
+ limit: number;
1225
+ /** The time period in seconds (10 for ten seconds, 60 for one minute). */
1226
+ period: 10 | 60;
1227
+ };
1228
+ }
1229
+ /** Binding to a rate limiter. */
1230
+ interface RateLimitBinding extends RateLimitBindingOptions {
1231
+ type: "rate-limit";
1232
+ }
1233
+ /**
1234
+ * Declares a secret that is required by your Worker, exposed on `env` under
1235
+ * the binding name.
1236
+ *
1237
+ * When defined, this binding:
1238
+ * - Replaces .dev.vars/.env/process.env inference for type generation
1239
+ * - Enables local dev validation with warnings for missing secrets
1240
+ *
1241
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
1242
+ */
1243
+ interface SecretBinding {
1244
+ type: "secret";
1245
+ }
1246
+ interface SecretsStoreSecretBindingOptions {
1247
+ /** ID of the secret store. */
1248
+ storeId: string;
1249
+ /** Name of the secret. */
1250
+ secretName: string;
1251
+ }
1252
+ /** Binding to a Secrets Store secret. */
1253
+ interface SecretsStoreSecretBinding extends SecretsStoreSecretBindingOptions {
1254
+ type: "secrets-store-secret";
1255
+ }
1256
+ type SendEmailDestinationOptions = {
1257
+ /** If this binding should be restricted to a specific verified address. */
1258
+ destinationAddress: string;
1259
+ allowedDestinationAddresses?: never;
1260
+ } | {
1261
+ destinationAddress?: never;
1262
+ /** If this binding should be restricted to a set of verified addresses. */
1263
+ allowedDestinationAddresses: string[];
1264
+ } | {
1265
+ destinationAddress?: never;
1266
+ allowedDestinationAddresses?: never;
1267
+ };
1268
+ type SendEmailBindingOptions = SendEmailDestinationOptions & {
1269
+ /** If this binding should be restricted to a set of sender addresses. */
1270
+ allowedSenderAddresses?: string[];
1271
+ /** Options that only apply during local development. */
1272
+ dev?: BindingDevOptions;
1273
+ };
1274
+ /**
1275
+ * Binding for sending email from inside the Worker.
1276
+ *
1277
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
1278
+ */
1279
+ type SendEmailBinding = SendEmailBindingOptions & {
1280
+ type: "send-email";
1281
+ };
1282
+ interface StreamBindingOptions {
1283
+ /** Options that only apply during local development. */
1284
+ dev?: BindingDevOptions;
1285
+ }
1286
+ /** Binding to Cloudflare Stream. */
1287
+ interface StreamBinding$1 extends StreamBindingOptions {
1288
+ type: "stream";
1289
+ }
1290
+ /**
1291
+ * Inline string value made available to the Worker on `env` under the
1292
+ * binding name.
1293
+ *
1294
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
1295
+ */
1296
+ interface TextBinding<T$1 extends string = string> {
1297
+ type: "text";
1298
+ /** The string value made available to the Worker. */
1299
+ value: T$1;
1300
+ }
1301
+ interface UnsafeBindingOptions {
1302
+ /** Local-dev plugin configuration for this unsafe binding. */
1303
+ dev?: {
1304
+ /** The plugin package that provides the binding's local-dev implementation. */
1305
+ plugin: {
1306
+ package: string;
1307
+ name: string;
1308
+ };
1309
+ /** Plugin-specific options. */
1310
+ options?: Record<string, unknown>;
1311
+ };
1312
+ [key: string]: unknown;
1313
+ }
1314
+ /**
1315
+ * Escape-hatch binding for runtime features that aren't directly supported
1316
+ * by this configuration. Included in the Worker's upload metadata without
1317
+ * changes.
1318
+ */
1319
+ interface UnsafeBinding extends UnsafeBindingOptions {
1320
+ type: `unsafe:${string}`;
1321
+ }
1322
+ interface VectorizeBindingOptions {
1323
+ /** The name of the Vectorize index. */
1324
+ name: string;
1325
+ /** Options that only apply during local development. */
1326
+ dev?: BindingDevOptions;
1327
+ }
1328
+ /**
1329
+ * Binding to a Vectorize index.
1330
+ *
1331
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
1332
+ */
1333
+ interface VectorizeBinding extends VectorizeBindingOptions {
1334
+ type: "vectorize";
1335
+ }
1336
+ /** Binding to the Worker version's metadata. */
1337
+ interface VersionMetadataBinding {
1338
+ type: "version-metadata";
1339
+ }
1340
+ type VpcNetworkBindingOptions = {
1341
+ /** The tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with `networkId`. */
1342
+ tunnelId: string;
1343
+ networkId?: never;
1344
+ /** Options that only apply during local development. */
1345
+ dev?: BindingDevOptions;
1346
+ } | {
1347
+ tunnelId?: never;
1348
+ /** The network ID to route traffic through. Mutually exclusive with `tunnelId`. */
1349
+ networkId: string;
1350
+ /** Options that only apply during local development. */
1351
+ dev?: BindingDevOptions;
1352
+ };
1353
+ /** Binding to a VPC network. */
1354
+ type VpcNetworkBinding = VpcNetworkBindingOptions & {
1355
+ type: "vpc-network";
1356
+ };
1357
+ interface VpcServiceBindingOptions {
1358
+ /** The service ID of the VPC connectivity service. */
1359
+ id: string;
1360
+ /** Options that only apply during local development. */
1361
+ dev?: BindingDevOptions;
1362
+ }
1363
+ /** Binding to a VPC service. */
1364
+ interface VpcServiceBinding extends VpcServiceBindingOptions {
1365
+ type: "vpc-service";
1366
+ }
1367
+ interface WebSearchBindingOptions {
1368
+ /** Options that only apply during local development. */
1369
+ dev?: BindingDevOptions;
1370
+ }
1371
+ /**
1372
+ * Cloudflare Web Search binding. There is exactly one shared web corpus, so
1373
+ * the binding is zero-config — only the variable name is required.
1374
+ */
1375
+ interface WebSearchBinding extends WebSearchBindingOptions {
1376
+ type: "web-search";
1377
+ }
1378
+ interface WorkerBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = WorkerEntrypointExportName<TWorker$1> | undefined> {
1379
+ /** The name or config of the bound Worker. */
1380
+ worker: TWorker$1;
1381
+ /** The named export to bind to (defaults to the default export). */
1382
+ exportName?: TExportName$1;
1383
+ /** Optional properties that will be made available to the service via `ctx.props`. */
1384
+ props?: Record<string, unknown>;
1385
+ /** Options that only apply during local development. */
1386
+ dev?: BindingDevOptions;
1387
+ }
1388
+ /**
1389
+ * Service binding (Worker-to-Worker). `worker` is the name or config of the
1390
+ * bound Worker; `exportName` selects a named `WorkerEntrypoint` export
1391
+ * (defaults to the default export).
1392
+ *
1393
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
1394
+ */
1395
+ interface WorkerBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = WorkerEntrypointExportName<TWorker$1> | undefined> extends WorkerBindingOptions<TWorker$1, TExportName$1> {
1396
+ type: "worker";
1397
+ }
1398
+ /** Binding to a Worker Loader. */
1399
+ interface WorkerLoaderBinding {
1400
+ type: "worker-loader";
1401
+ }
1402
+ interface WorkflowBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> {
1403
+ /** The name or config of the Worker that defines the Workflow. */
1404
+ worker: TWorker$1;
1405
+ /** The exported class name of the Workflow. */
1406
+ exportName: TExportName$1;
1407
+ }
1408
+ /**
1409
+ * Binding to a Workflow. `worker` is the name or config of the Worker that
1410
+ * defines the Workflow; `exportName` is the exported `WorkflowEntrypoint`
1411
+ * class name.
1412
+ */
1413
+ interface WorkflowBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> extends WorkflowBindingOptions<TWorker$1, TExportName$1> {
1414
+ type: "workflow";
1415
+ }
1416
+ interface Bindings {
1177
1417
  /**
1178
- * Custom domains that your Worker should be published to.
1179
- *
1180
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
1418
+ * Agent Memory namespace binding. Each binding is scoped to a namespace and
1419
+ * allows agents to persist and recall memory.
1181
1420
  */
1182
- domains?: string[];
1421
+ agentMemory(options: AgentMemoryBindingOptions): AgentMemoryBinding;
1183
1422
  /**
1184
- * Event triggers — fetch routes, queue consumers, cron schedules, Email
1185
- * Routing addresses, and raw sockets — that invoke this Worker.
1186
- * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
1187
- * `triggers.scheduled(...)`, `triggers.email(...)`, or
1188
- * `triggers.connect(...)`.
1423
+ * Binding to the Workers AI project.
1189
1424
  *
1190
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
1425
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
1191
1426
  */
1192
- triggers?: Trigger[];
1427
+ ai<TAiModelList extends AiModelListType = AiModels>(options?: AiBindingOptions): TypedAiBinding<TAiModelList>;
1193
1428
  /**
1194
- * A list of Tail Workers that are bound to this Worker.
1195
- *
1196
- * `@cloudflare/config` unifies regular and streaming tail consumers under
1197
- * a single field; pass `streaming: true` to forward streaming tail events.
1429
+ * AI Search instance binding. Each binding is bound directly to a single
1430
+ * pre-existing instance within the "default" namespace.
1431
+ */
1432
+ aiSearch(options: AiSearchBindingOptions): AiSearchBinding;
1433
+ /**
1434
+ * AI Search namespace binding. Each binding is scoped to a namespace and
1435
+ * allows dynamic instance CRUD within it.
1436
+ */
1437
+ aiSearchNamespace(options: AiSearchNamespaceBindingOptions): AiSearchNamespaceBinding;
1438
+ /**
1439
+ * Binding to an Analytics Engine dataset.
1198
1440
  *
1199
- * @default []
1441
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
1200
1442
  */
1201
- tailConsumers?: Array<{
1202
- /** The name of the service tail events will be forwarded to. */
1203
- worker: string;
1204
- /** Whether to stream tail events in real time. */
1205
- streaming?: boolean;
1206
- }>;
1443
+ analyticsEngineDataset(options?: AnalyticsEngineDatasetBindingOptions): AnalyticsEngineDatasetBinding;
1207
1444
  /**
1208
- * Specify the cache behavior of the Worker.
1445
+ * Binding to an Artifacts instance. Artifacts provides git-compatible file
1446
+ * storage on Cloudflare Workers.
1209
1447
  */
1210
- cache?: {
1211
- /** If cache is enabled for this Worker. */
1212
- enabled: boolean;
1213
- /** Whether cached assets may be reused across Worker versions. */
1214
- crossVersionCache?: boolean;
1215
- };
1448
+ artifacts(options: ArtifactsBindingOptions): ArtifactsBinding;
1216
1449
  /**
1217
- * Specify how the Worker should be located to minimize round-trip time.
1450
+ * Binding to the Worker's static assets.
1218
1451
  *
1219
- * More details: https://developers.cloudflare.com/workers/platform/smart-placement/
1452
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
1220
1453
  */
1221
- placement?: {
1222
- mode: "off" | "smart";
1223
- hint?: string;
1224
- } | {
1225
- mode?: "targeted";
1226
- region: string;
1227
- } | {
1228
- mode?: "targeted";
1229
- host: string;
1230
- } | {
1231
- mode?: "targeted";
1232
- hostname: string;
1233
- };
1454
+ assets(): AssetsBinding;
1234
1455
  /**
1235
- * Specify limits for runtime behavior.
1236
- * Only supported for the "standard" Usage Model.
1456
+ * Binding to a headless browser usable from the Worker.
1237
1457
  *
1238
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
1458
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
1239
1459
  */
1240
- limits?: {
1241
- /** Maximum allowed CPU time for a Worker's invocation in milliseconds. */
1242
- cpuMs?: number;
1243
- /** Maximum allowed number of fetch requests that a Worker's invocation can execute. */
1244
- subrequests?: number;
1245
- };
1460
+ browser(options?: BrowserBindingOptions): BrowserBinding;
1246
1461
  /**
1247
- * Send Trace Events from this Worker to Workers Logpush.
1462
+ * Binding to a D1 database.
1248
1463
  *
1249
- * This will not configure a corresponding Logpush job automatically.
1464
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
1465
+ */
1466
+ d1(options?: D1BindingOptions): D1Binding;
1467
+ /**
1468
+ * Binding to a Workers for Platforms dispatch namespace.
1250
1469
  *
1251
- * For more information about Workers Logpush, see:
1252
- * https://blog.cloudflare.com/logpush-for-workers/
1470
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
1253
1471
  */
1254
- logpush?: boolean;
1472
+ dispatchNamespace(options?: DispatchNamespaceBindingOptions): DispatchNamespaceBinding;
1255
1473
  /**
1256
- * Specify the observability behavior of the Worker.
1474
+ * Binding to a Durable Object class. `worker` is the name or config of the
1475
+ * Worker that defines the class; `exportName` is the exported class name.
1257
1476
  *
1258
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
1477
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1259
1478
  */
1260
- observability?: {
1261
- /** If observability is enabled for this Worker. */
1262
- enabled?: boolean;
1263
- /** The sampling rate. */
1264
- headSamplingRate?: number;
1265
- /**
1266
- * Whether query strings are removed from request URLs in logs and traces.
1267
- *
1268
- * @default false
1269
- */
1270
- redactQueryString?: boolean;
1271
- logs?: {
1272
- enabled?: boolean;
1273
- /** The sampling rate. */
1274
- headSamplingRate?: number;
1275
- /** Set to false to disable invocation logs. */
1276
- invocationLogs?: boolean;
1277
- /**
1278
- * If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
1279
- *
1280
- * @default true
1281
- */
1282
- persist?: boolean;
1283
- /**
1284
- * What destinations logs emitted from the Worker should be sent to.
1285
- *
1286
- * @default []
1287
- */
1288
- destinations?: string[];
1289
- };
1290
- traces?: {
1291
- enabled?: boolean;
1292
- /** The sampling rate. */
1293
- headSamplingRate?: number;
1294
- /**
1295
- * If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
1296
- *
1297
- * @default true
1298
- */
1299
- persist?: boolean;
1300
- /**
1301
- * What destinations traces emitted from the Worker should be sent to.
1302
- *
1303
- * @default []
1304
- */
1305
- destinations?: string[];
1306
- };
1307
- };
1479
+ durableObject<TWorker$1 extends WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1>>(options: DurableObjectBindingOptions<TWorker$1, TExportName$1>): DurableObjectBinding<TWorker$1, TExportName$1>;
1480
+ /** Binding to a Flagship feature-flag service. */
1481
+ flagship(options?: FlagshipBindingOptions): FlagshipBinding;
1308
1482
  /**
1309
- * Whether we use `<name>.<subdomain>.workers.dev` to
1310
- * test and deploy your Worker.
1483
+ * Binding to a Hyperdrive configuration.
1311
1484
  *
1312
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
1485
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
1486
+ */
1487
+ hyperdrive(options: HyperdriveBindingOptions): HyperdriveBinding;
1488
+ /**
1489
+ * Binding to Cloudflare Images.
1313
1490
  *
1314
- * @default true
1491
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
1315
1492
  */
1316
- workersDev?: boolean;
1493
+ images(options?: ImagesBindingOptions): ImagesBinding$1;
1317
1494
  /**
1318
- * Whether we use `<version>-<name>.<subdomain>.workers.dev` to
1319
- * serve Preview URLs for your Worker.
1495
+ * Inline JSON value made available to the Worker on `env` under the
1496
+ * binding name.
1497
+ */
1498
+ json<T$1 extends Json>(value: T$1): JsonBinding<T$1>;
1499
+ /**
1500
+ * Binding to a Workers KV namespace.
1320
1501
  *
1321
- * @default false
1502
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
1322
1503
  */
1323
- previewUrls?: boolean;
1504
+ kv<TKey extends string = string>(options?: KvBindingOptions): TypedKvBinding<TKey>;
1505
+ /** Binding for forwarding logs to logfwdr. */
1506
+ logfwdr(options: LogfwdrBindingOptions): LogfwdrBinding;
1507
+ /** Binding to Cloudflare Media Transformations. */
1508
+ media(options?: MediaBindingOptions): MediaBinding$1;
1324
1509
  /**
1325
- * Designates this Worker as an internal-only "first-party" Worker.
1510
+ * Binding to an uploaded mTLS certificate.
1326
1511
  *
1327
- * @internal
1512
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
1328
1513
  */
1329
- firstPartyWorker?: boolean;
1514
+ mtlsCertificate(options: MtlsCertificateBindingOptions): MtlsCertificateBinding;
1515
+ /** Binding to a Cloudflare Pipeline. */
1516
+ pipeline<TRecord extends PipelineRecord = PipelineRecord>(options: PipelineBindingOptions): TypedPipelineBinding<TRecord>;
1330
1517
  /**
1331
- * "Unsafe" tables for runtime features that aren't directly supported by
1332
- * this configuration. Values are forwarded verbatim in the Worker's
1333
- * upload metadata.
1518
+ * Producer binding to a Cloudflare Queue.
1334
1519
  *
1335
- * @default {}
1520
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
1336
1521
  */
1337
- unsafe?: {
1338
- /**
1339
- * Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
1340
- * here will always be applied to metadata last, so can add new or override existing fields.
1341
- */
1342
- metadata?: Record<string, unknown>;
1343
- /**
1344
- * Used for internal capnp uploads for the Workers runtime.
1345
- */
1346
- capnp?: {
1347
- basePath: string;
1348
- sourceSchemas: string[];
1349
- compiledSchema?: never;
1350
- } | {
1351
- basePath?: never;
1352
- sourceSchemas?: never;
1353
- compiledSchema: string;
1354
- };
1355
- };
1522
+ queue<TBody = unknown>(options?: QueueBindingOptions): TypedQueueBinding<TBody>;
1356
1523
  /**
1357
- * Bindings exposed on the Worker's `env` object. Construct entries with
1358
- * `bindings.kv(...)`, `bindings.r2(...)`, etc.
1524
+ * Binding to an R2 bucket.
1525
+ *
1526
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
1359
1527
  */
1360
- env?: Record<string, Binding>;
1528
+ r2(options?: R2BindingOptions): R2Binding;
1529
+ /** Binding to a rate limiter. */
1530
+ rateLimit(options: RateLimitBindingOptions): RateLimitBinding;
1361
1531
  /**
1362
- * Configuration for named exports declared by the Worker. Each entry's
1363
- * key is the exported class name; the value configures the export.
1532
+ * Declares a secret that is required by your Worker, exposed on `env` under
1533
+ * the binding name.
1364
1534
  *
1365
- * Only one export kind is currently supported:
1535
+ * When defined, this binding:
1536
+ * - Replaces .dev.vars/.env/process.env inference for type generation
1537
+ * - Enables local dev validation with warnings for missing secrets
1366
1538
  *
1367
- * - Construct entries with `exports.durableObject(...)`.
1368
- * - Declares Durable Object classes exported from this Worker.
1369
- * For more information about Durable Objects, see the documentation at
1370
- * https://developers.cloudflare.com/workers/learning/using-durable-objects.
1371
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects.
1539
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
1372
1540
  */
1373
- exports?: Record<string, Export>;
1374
- }
1375
- /**
1376
- * Settings shared by the other exports.
1377
- * Authored as a named `settings` export via
1378
- * `defineSettings`.
1379
- */
1380
- interface SettingsConfig {
1541
+ secret(): SecretBinding;
1542
+ /** Binding to a Secrets Store secret. */
1543
+ secretsStoreSecret(options: SecretsStoreSecretBindingOptions): SecretsStoreSecretBinding;
1381
1544
  /**
1382
- * Discriminates this config as a settings config.
1545
+ * Binding for sending email from inside the Worker.
1383
1546
  *
1384
- * Injected automatically by `defineSettings`; only needs to be written by
1385
- * hand when authoring a raw config object without the helper.
1547
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
1386
1548
  */
1387
- type: "settings";
1549
+ sendEmail(options?: SendEmailBindingOptions): SendEmailBinding;
1550
+ /** Binding to Cloudflare Stream. */
1551
+ stream(options?: StreamBindingOptions): StreamBinding$1;
1388
1552
  /**
1389
- * This is the ID of the account associated with your zone.
1390
- * You might have more than one account, so make sure to use
1391
- * the ID of the account associated with the zone/route you
1392
- * provide, if you provide one. It can also be specified through
1393
- * the CLOUDFLARE_ACCOUNT_ID environment variable.
1553
+ * Inline string value made available to the Worker on `env` under the
1554
+ * binding name.
1555
+ *
1556
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
1394
1557
  */
1395
- accountId?: string;
1558
+ text<T$1 extends string>(value: T$1): TextBinding<T$1>;
1396
1559
  /**
1397
- * Specify the compliance region mode of the Worker.
1560
+ * Binding to a Vectorize index.
1398
1561
  *
1399
- * Although if the user does not specify a compliance region, the default is `public`,
1400
- * it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
1562
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
1401
1563
  */
1402
- complianceRegion?: "public" | "fedramp-high";
1403
- }
1404
- //#endregion
1405
- //#region src/worker-definition.d.ts
1406
- /**
1407
- * Base shape of a Worker definition. Carries the authored config (under
1408
- * {@link DEFINITION}) and the untyped cross-worker binding helpers.
1409
- */
1410
- interface WorkerDefinition<TConfig$1 extends WorkerConfig = WorkerConfig> extends Pick<Bindings, "durableObject" | "worker"> {
1411
- [DEFINITION]: {
1412
- config: ConfigInput<Omit<TConfig$1, "type">>;
1413
- type: "worker";
1414
- };
1415
- }
1416
- /**
1417
- * Worker definition with typed cross-worker binding helpers.
1418
- */
1419
- interface TypedWorkerDefinition<TConfig$1 extends WorkerConfig, TWorkerName extends string = InferWorkerName<TConfig$1>> extends WorkerDefinition<TConfig$1> {
1564
+ vectorize(options: VectorizeBindingOptions): VectorizeBinding;
1565
+ /** Binding to the Worker version's metadata. */
1566
+ versionMetadata(): VersionMetadataBinding;
1567
+ /** Binding to a VPC network. */
1568
+ vpcNetwork(options: VpcNetworkBindingOptions): VpcNetworkBinding;
1569
+ /** Binding to a VPC service. */
1570
+ vpcService(options: VpcServiceBindingOptions): VpcServiceBinding;
1420
1571
  /**
1421
- * Binding to a Durable Object class. `worker` is the name of the Worker
1422
- * that defines the class; `exportName` is the exported class name.
1423
- *
1424
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1572
+ * Cloudflare Web Search binding. There is exactly one shared web corpus, so
1573
+ * the binding is zero-config — only the variable name is required.
1425
1574
  */
1426
- durableObject<TExportName$1 extends InferDurableNamespaces<TConfig$1>>(options: {
1427
- worker: TWorkerName;
1428
- exportName: TExportName$1;
1429
- }): TypedDurableObjectBinding<TConfig$1, TExportName$1>;
1575
+ webSearch(options?: WebSearchBindingOptions): WebSearchBinding;
1430
1576
  /**
1431
- * Service binding (Worker-to-Worker). `worker` is the name of the bound
1432
- * Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
1433
- * the default export).
1577
+ * Service binding (Worker-to-Worker). `worker` is the name or config of the
1578
+ * bound Worker; `exportName` selects a named `WorkerEntrypoint` export
1579
+ * (defaults to the default export).
1434
1580
  *
1435
1581
  * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
1436
1582
  */
1437
- worker<TExportName$1 extends InferWorkerEntrypointExports<TConfig$1> | undefined = undefined>(options: {
1438
- worker: TWorkerName;
1439
- exportName?: TExportName$1;
1440
- props?: Record<string, unknown>;
1441
- dev?: BindingDevOptions;
1442
- }): TypedWorkerBinding<TConfig$1, TExportName$1 extends string ? TExportName$1 : "default">;
1443
- }
1444
- type WorkerConfigExport<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
1445
- /**
1446
- * Authored Worker config shape — {@link WorkerConfig} without the `type`
1447
- * discriminant, which `defineWorker` injects.
1448
- */
1449
- type WorkerConfigInput = Omit<WorkerConfig, "type">;
1450
- declare function defineWorker<const T$1 extends WorkerConfigInput>(config: (ctx: ConfigContext) => (WorkerConfigInput & T$1) | Promise<WorkerConfigInput & T$1>): TypedWorkerDefinition<T$1 & {
1451
- type: "worker";
1452
- }>;
1453
- declare function defineWorker<const T$1 extends WorkerConfigInput>(config: (WorkerConfigInput & T$1) | Promise<WorkerConfigInput & T$1>): TypedWorkerDefinition<T$1 & {
1454
- type: "worker";
1455
- }>;
1456
- //#endregion
1457
- //#region src/inference.d.ts
1458
- /**
1459
- * The Worker's entry module, imported with the `{ type: "cf-worker" }` import attribute
1460
- * @example
1461
- * ```ts
1462
- * import * as entrypoint from "./src" with { type: "cf-worker" };
1463
- * ```
1464
- */
1465
- type WorkerModule = Record<string, any>;
1466
- /**
1467
- * Default module type representing an unknown Worker's exports.
1468
- * - default export can be `ExportedHandler` or a `WorkerEntrypoint` class constructor
1469
- * - named exports can be `WorkerEntrypoint`, `DurableObject`, or `WorkflowEntrypoint` class constructors
1470
- */
1471
- interface DefaultModule {
1472
- default?: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded>;
1473
- [key: string]: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded> | Constructor<Rpc.DurableObjectBranded> | Constructor<Rpc.WorkflowEntrypointBranded> | undefined;
1474
- }
1475
- /**
1476
- * Represents a class constructor that creates instances of TInstance.
1477
- */
1478
- type Constructor<TInstance> = new (...args: any[]) => TInstance;
1479
- /**
1480
- * Extracts the instance type from a class constructor if it extends `TInstance`.
1481
- */
1482
- type ExtractInstance<T$1, TInstance> = T$1 extends Constructor<TInstance> ? InstanceType<T$1> : never;
1483
- /**
1484
- * Mapping from binding type literals to Cloudflare runtime types.
1485
- *
1486
- * Entries fall into two groups:
1487
- * - Parameterized bindings (ai, json, kv, pipeline, queue, text) refine their
1488
- * runtime type from the binding instance via nominal matches against the
1489
- * `Typed*Binding` / `JsonBinding` / `TextBinding` interfaces from
1490
- * `./bindings`. When `TBinding` does not match, the entry falls back to the
1491
- * unparameterized runtime type.
1492
- * - Non-parameterized bindings map their type literal directly to a runtime
1493
- * type and ignore `TBinding`.
1494
- *
1495
- * IMPORTANT: The right-hand-side identifiers in this map (e.g. `KVNamespace`,
1496
- * `ImagesBinding`, `Fetcher`) must resolve to the ambient runtime types from
1497
- * `@cloudflare/workers-types`, not to local config interfaces. Several local
1498
- * binding interfaces in `./bindings.ts` (`ImagesBinding`, `MediaBinding`,
1499
- * `StreamBinding`) share names with ambient globals — importing those local
1500
- * types into this file silently shadows the globals and breaks `InferEnv`.
1501
- * Only import the `Typed*Binding`, `JsonBinding`, and `TextBinding` interfaces
1502
- * from `./bindings` (their names do not collide with ambient globals); never
1503
- * widen the import to a wildcard or to the plain `*Binding` interfaces.
1504
- */
1505
- interface BindingTypeMap<TBinding> {
1506
- ai: TBinding extends TypedAiBinding<infer T> ? Ai<T> : Ai;
1507
- json: TBinding extends JsonBinding<infer T> ? T : never;
1508
- kv: TBinding extends TypedKvBinding<infer T> ? KVNamespace<T> : KVNamespace;
1509
- pipeline: TBinding extends TypedPipelineBinding<infer T> ? Pipeline<T> : Pipeline;
1510
- queue: TBinding extends TypedQueueBinding<infer T> ? Queue<T> : Queue;
1511
- text: TBinding extends TextBinding<infer T> ? T : never;
1512
- "agent-memory": AgentMemoryNamespace;
1513
- "ai-search": AiSearchInstance;
1514
- "ai-search-namespace": AiSearchNamespace;
1515
- "analytics-engine-dataset": AnalyticsEngineDataset;
1516
- artifacts: Artifacts;
1517
- assets: Fetcher;
1518
- browser: BrowserRun;
1519
- d1: D1Database;
1520
- "dispatch-namespace": DispatchNamespace;
1521
- "durable-object": DurableObjectNamespace;
1522
- flagship: Flagship;
1523
- hyperdrive: Hyperdrive;
1524
- images: ImagesBinding;
1525
- logfwdr: any;
1526
- media: MediaBinding;
1527
- "mtls-certificate": Fetcher;
1528
- "rate-limit": RateLimit;
1529
- r2: R2Bucket;
1530
- secret: string;
1531
- "secrets-store-secret": SecretsStoreSecret;
1532
- "send-email": SendEmail;
1533
- stream: StreamBinding;
1534
- vectorize: VectorizeIndex;
1535
- "version-metadata": WorkerVersionMetadata;
1536
- "vpc-service": Fetcher;
1537
- "vpc-network": Fetcher;
1538
- "web-search": WebSearch;
1539
- worker: Fetcher;
1540
- "worker-loader": WorkerLoader;
1541
- workflow: Workflow;
1583
+ worker<TWorker$1 extends WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = undefined>(options: WorkerBindingOptions<TWorker$1, TExportName$1>): WorkerBinding<TWorker$1, NoInfer<TExportName$1>>;
1584
+ /** Binding to a Worker Loader. */
1585
+ workerLoader(): WorkerLoaderBinding;
1542
1586
  }
1543
- type InferBindingType<TBinding> = TBinding extends TypedWorkerBinding<infer TConfig, infer TExportName extends string> ? InferMainModule<TConfig> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? TModule[TExportName] extends Constructor<any> ? Fetcher<ExtractInstance<TModule[TExportName], Rpc.WorkerEntrypointBranded>> : Fetcher : never : never : TBinding extends TypedDurableObjectBinding<infer TConfig, infer TExportName extends string> ? InferMainModule<TConfig> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? DurableObjectNamespace<ExtractInstance<TModule[TExportName], Rpc.DurableObjectBranded>> : never : never : TBinding extends TypedWorkflowBinding<infer TConfig, infer TExportName extends string> ? InferMainModule<TConfig> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? ExtractInstance<TModule[TExportName], Rpc.WorkflowEntrypointBranded> extends infer TWorkflow ? TWorkflow extends {
1544
- run(event: {
1545
- payload: infer P;
1546
- }, step: any): any;
1547
- } ? Workflow<P> : Workflow : Workflow : never : never : TBinding extends {
1548
- type: `unsafe:${string}`;
1549
- } ? any : TBinding extends {
1550
- type: infer K extends keyof BindingTypeMap<TBinding>;
1551
- } ? BindingTypeMap<TBinding>[K] : never;
1552
- /**
1553
- * Infer the Worker name from a config.
1554
- *
1555
- * @example
1556
- * ```typescript
1557
- * import { defineWorker } from "@cloudflare/config";
1558
- * import type { InferDurableNamespaces, UnwrapConfig } from "@cloudflare/config";
1559
- *
1560
- * const config = defineWorker({ name: "my-worker", ... });
1561
- *
1562
- * type WorkerConfig = UnwrapConfig<typeof config>;
1563
- * // Inferred as: "my-worker"
1564
- * type Name = InferWorkerName<WorkerConfig>;
1565
- * ```
1566
- */
1567
- type InferWorkerName<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
1568
- name: infer TName extends string;
1569
- } ? TName : never;
1570
- /**
1571
- * Infer export names from a config's exports, optionally filtered by type.
1572
- * When TExportType is `string` (default), returns all export names.
1573
- * When TExportType is a specific literal like `"durable-object"` or `"workflow"`,
1574
- * returns only exports of that type.
1575
- */
1576
- type InferExportsByType<TUnwrappedConfig$1, TExportType extends string = string> = TUnwrappedConfig$1 extends {
1577
- exports: infer TExports extends Record<string, {
1578
- type: string;
1579
- }>;
1580
- } ? { [K in keyof TExports]: TExports[K] extends {
1581
- type: TExportType;
1582
- } ? K & string : never }[keyof TExports] : never;
1583
- /**
1584
- * Infer `WorkerEntrypoint` export names from a config.
1585
- * Returns named module exports that are not declared as type `"durable-object"` or `"workflow"` in `exports`.
1586
- * Excludes `"default"` since `exportName` should only be provided for named exports.
1587
- */
1588
- type InferWorkerEntrypointExports<TUnwrappedConfig$1> = Exclude<keyof InferMainModule<TUnwrappedConfig$1> & string, "default" | InferExportsByType<TUnwrappedConfig$1, "durable-object" | "workflow">>;
1589
- /**
1590
- * Unwrap function and promise types to get the underlying config.
1591
- * Use this to normalize a config before passing it to other inference utilities.
1592
- */
1593
- type UnwrapConfig<TConfig$1> = TConfig$1 extends WorkerDefinition<infer TUnwrappedConfig> ? TUnwrappedConfig : TConfig$1 extends WorkerConfigExport<infer TUnwrappedConfig> ? TUnwrappedConfig : never;
1594
- /**
1595
- * Infer the `Env` interface type from a Worker config.
1596
- *
1597
- * Transforms a config object's `env` bindings into their
1598
- * corresponding Cloudflare runtime types.
1599
- *
1600
- * @example
1601
- * ```typescript
1602
- * import { defineWorker, bindings } from "@cloudflare/config";
1603
- * import type { InferEnv, UnwrapConfig } from "@cloudflare/config";
1604
- *
1605
- * const config = defineWorker({
1606
- * env: {
1607
- * MY_JSON: bindings.json({ id: string }),
1608
- * MY_KV: bindings.kv(),
1609
- * },
1610
- * });
1611
- *
1612
- * type WorkerConfig = UnwrapConfig<typeof config>;
1613
- * // Inferred as: { MY_JSON: { id: string }; MY_KV: KVNamespace }
1614
- * export type Env = InferEnv<WorkerConfig>;
1615
- * ```
1616
- */
1617
- type InferEnv<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
1618
- env: infer TEnv extends Record<string, any>;
1619
- } ? { [K in keyof TEnv]: InferBindingType<TEnv[K]> } : never;
1620
- /**
1621
- * Infer the Durable Object namespace names from a Worker config's exports.
1622
- * Returns a union of export names that declare a *live* Durable Object —
1623
- * `type: "durable-object"` with `state` either omitted, `"created"`, or
1624
- * `"expecting-transfer"`. Tombstone entries (`deleted`, `renamed`,
1625
- * `transferred`) are excluded because they retire the namespace and a
1626
- * binding to a tombstoned class would fail at deploy time.
1627
- *
1628
- * @example
1629
- * ```typescript
1630
- * import { defineWorker } from "@cloudflare/config";
1631
- * import type { InferDurableNamespaces, UnwrapConfig } from "@cloudflare/config";
1632
- *
1633
- * const config = defineWorker({
1634
- * exports: {
1635
- * MyDurableObject: { type: "durable-object", storage: "sqlite" },
1636
- * OldGone: { type: "durable-object", state: "deleted" },
1637
- * },
1638
- * });
1639
- *
1640
- * type WorkerConfig = UnwrapConfig<typeof config>;
1641
- * // Inferred as: "MyDurableObject" (the deleted tombstone is excluded)
1642
- * type DurableNamespaces = InferDurableNamespaces<WorkerConfig>;
1643
- * ```
1644
- */
1645
- type InferDurableNamespaces<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
1646
- exports: infer TExports extends Record<string, {
1647
- type: string;
1648
- }>;
1649
- } ? { [K in keyof TExports]: TExports[K] extends {
1650
- type: "durable-object";
1651
- } ? TExports[K] extends {
1652
- state: "deleted" | "renamed" | "transferred";
1653
- } ? never : K & string : never }[keyof TExports] : never;
1654
- /**
1655
- * Infer the main module type from a Worker config's entrypoint.
1656
- * If entrypoint is a module namespace object, returns that type.
1657
- * If entrypoint is a `string` or not present, returns `DefaultModule` as a fallback.
1658
- */
1659
- type InferMainModule<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
1660
- entrypoint: infer TModule extends WorkerModule;
1661
- } ? TModule : DefaultModule;
1587
+ declare const bindings: Bindings;
1662
1588
  //#endregion
1663
1589
  //#region src/settings-definition.d.ts
1590
+ type SettingsConfigExport<T$1 extends SettingsConfig = SettingsConfig> = ConfigInput<T$1>;
1664
1591
  /**
1665
1592
  * Authored settings config shape — {@link SettingsConfig} without the `type`
1666
1593
  * discriminant, which `defineSettings` injects.
1667
1594
  */
1668
1595
  type SettingsConfigInput = Omit<SettingsConfig, "type">;
1669
- /**
1670
- * A settings definition created by {@link defineSettings}.
1671
- */
1672
- interface SettingsDefinition {
1673
- [DEFINITION]: {
1674
- config: ConfigInput<SettingsConfigInput>;
1675
- type: "settings";
1676
- };
1677
- }
1678
1596
  /**
1679
1597
  * Declare shared settings.
1680
1598
  * Authored as a named `settings` export.
1681
1599
  */
1682
- declare function defineSettings(config: ConfigInput<SettingsConfigInput>): SettingsDefinition;
1600
+ declare const defineSettings: <const TInput extends ConfigInput<SettingsConfigInput>>(config: TInput) => TInput extends ((ctx: ConfigContext) => infer TResult) ? (ctx: ConfigContext) => TResult extends Promise<infer TConfig extends {
1601
+ [x: string]: unknown;
1602
+ }> ? Promise<ConfigWithType<TConfig, "settings">> : TResult extends {
1603
+ [x: string]: unknown;
1604
+ } ? ConfigWithType<TResult, "settings"> : never : TInput extends Promise<infer TConfig extends {
1605
+ [x: string]: unknown;
1606
+ }> ? Promise<ConfigWithType<TConfig, "settings">> : TInput extends {
1607
+ [x: string]: unknown;
1608
+ } ? ConfigWithType<TInput, "settings"> : never;
1683
1609
  //#endregion
1684
1610
  //#endregion
1685
- export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BindingDevOptions, Bindings, BrowserBinding, ConfigContext, ConnectTrigger, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding$1 as ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding$1 as MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, SettingsDefinition, StreamBinding$1 as StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkflowBinding, bindings, defineSettings, defineWorker, exports, triggers };
1611
+ export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BindingDevOptions, Bindings, BrowserBinding, ConfigContext, ConnectTrigger, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding$1 as ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding$1 as MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigExport, SettingsConfigInput, StreamBinding$1 as StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkerReference, WorkflowBinding, bindings, defineSettings, defineWorker, exports, triggers };
1686
1612
  //# sourceMappingURL=experimental-config.d.mts.map