@cloudflare/config 0.9.0 → 0.11.0

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