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