wrangler 0.0.0-e1d50407 → 0.0.0-e1e76ce2

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.
@@ -6,24 +6,30 @@ import type { DispatchFetch } from 'miniflare';
6
6
  import { Duplex } from 'stream';
7
7
  import { EventEmitter } from 'events';
8
8
  import { EventEmitter as EventEmitter_2 } from 'node:events';
9
+ import { IncomingMessage } from 'http';
10
+ import type { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental';
9
11
  import { IpcNetConnectOpts } from 'net';
10
12
  import type { Json } from 'miniflare';
13
+ import type { MessagePort as MessagePort_2 } from 'worker_threads';
11
14
  import type { Metafile } from 'esbuild';
12
15
  import { Miniflare } from 'miniflare';
13
16
  import type { MiniflareOptions } from 'miniflare';
17
+ import type { ModuleRule as ModuleRule_2 } from 'miniflare';
14
18
  import { Mutex } from 'miniflare';
15
19
  import { Readable } from 'stream';
16
- import { ReadableStream as ReadableStream_2 } from 'stream/web';
17
- import type { Request as Request_3 } from 'miniflare';
18
- import { Response as Response_3 } from 'miniflare';
19
- import { Socket as Socket_2 } from 'net';
20
+ import { ReadableStream } from 'stream/web';
21
+ import type { Request as Request_2 } from 'miniflare';
22
+ import { Response as Response_2 } from 'miniflare';
23
+ import type { Server } from 'node:http';
24
+ import { ServerResponse } from 'http';
25
+ import { Socket } from 'net';
20
26
  import { TcpNetConnectOpts } from 'net';
21
- import { TlsOptions as TlsOptions_2 } from 'tls';
22
27
  import { TLSSocket } from 'tls';
23
28
  import { URL as URL_2 } from 'url';
24
29
  import { UrlObject } from 'url';
25
30
  import { URLSearchParams as URLSearchParams_2 } from 'url';
26
- import { WebSocket as WebSocket_3 } from 'miniflare';
31
+ import { WebSocket as WebSocket_2 } from 'miniflare';
32
+ import type { WorkerOptions } from 'miniflare';
27
33
  import { Writable } from 'stream';
28
34
 
29
35
  declare type AbortSignal_2 = unknown;
@@ -47,7 +53,7 @@ declare class Agent extends Dispatcher{
47
53
  declare namespace Agent {
48
54
  interface Options extends Pool.Options {
49
55
  /** Default: `(origin, opts) => new Pool(origin, opts)`. */
50
- factory?(origin: URL_2, opts: Object): Dispatcher;
56
+ factory?(origin: string | URL_2, opts: Object): Dispatcher;
51
57
  /** Integer. Default: `0` */
52
58
  maxRedirections?: number;
53
59
 
@@ -68,10 +74,10 @@ declare type ApiCredentials = {
68
74
  };
69
75
 
70
76
  declare class BalancedPool extends Dispatcher {
71
- constructor(url: string | URL_2 | string[], options?: Pool.Options);
77
+ constructor(url: string | string[] | URL_2 | URL_2[], options?: Pool.Options);
72
78
 
73
- addUpstream(upstream: string): BalancedPool;
74
- removeUpstream(upstream: string): BalancedPool;
79
+ addUpstream(upstream: string | URL_2): BalancedPool;
80
+ removeUpstream(upstream: string | URL_2): BalancedPool;
75
81
  upstreams: Array<string>;
76
82
 
77
83
  /** `true` after `pool.close()` has been called. */
@@ -133,16 +139,26 @@ declare type Binding = {
133
139
  [key: string]: unknown;
134
140
  };
135
141
 
142
+ /**
143
+ * Result of the `getBindingsProxy` utility
144
+ */
145
+ export declare type BindingsProxy<Bindings = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties> = Omit<PlatformProxy<Bindings, CfProperties>, "env"> & {
146
+ /**
147
+ * Object containing the various proxies
148
+ */
149
+ bindings: Bindings;
150
+ };
151
+
136
152
  declare interface BlobPropertyBag {
137
153
  type?: string
138
154
  endings?: 'native' | 'transparent'
139
155
  }
140
156
 
141
- declare type BodyInit_2 =
157
+ declare type BodyInit =
142
158
  | ArrayBuffer
143
159
  | AsyncIterable<Uint8Array>
144
160
  | Blob_2
145
- | FormData_2
161
+ | FormData
146
162
  | Iterable<Uint8Array>
147
163
  | NodeJS.ArrayBufferView
148
164
  | URLSearchParams_2
@@ -150,12 +166,12 @@ declare type BodyInit_2 =
150
166
  | string
151
167
 
152
168
  declare interface BodyMixin {
153
- readonly body: ReadableStream_2 | null
169
+ readonly body: ReadableStream | null
154
170
  readonly bodyUsed: boolean
155
171
 
156
172
  readonly arrayBuffer: () => Promise<ArrayBuffer>
157
173
  readonly blob: () => Promise<Blob_2>
158
- readonly formData: () => Promise<FormData_2>
174
+ readonly formData: () => Promise<FormData>
159
175
  readonly json: () => Promise<unknown>
160
176
  readonly text: () => Promise<string>
161
177
  }
@@ -175,7 +191,7 @@ declare class BodyReadable extends Readable {
175
191
  /** Consumes and returns the body as a JavaScript Object
176
192
  * https://fetch.spec.whatwg.org/#dom-body-json
177
193
  */
178
- json(): Promise<any>
194
+ json(): Promise<unknown>
179
195
 
180
196
  /** Consumes and returns the body as a Blob
181
197
  * https://fetch.spec.whatwg.org/#dom-body-blob
@@ -221,6 +237,7 @@ declare function buildConnector (options?: buildConnector.BuildOptions): buildCo
221
237
 
222
238
  declare namespace buildConnector {
223
239
  type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & {
240
+ allowH2?: boolean;
224
241
  maxCachedSessions?: number | null;
225
242
  socketPath?: string | null;
226
243
  timeout?: number | null;
@@ -236,19 +253,13 @@ declare namespace buildConnector {
236
253
  port: string
237
254
  servername?: string
238
255
  localAddress?: string | null
239
- httpSocket?: Socket_2
256
+ httpSocket?: Socket
240
257
  }
241
258
 
242
259
  type Callback = (...args: CallbackArgs) => void
243
- type CallbackArgs = [null, Socket_2 | TLSSocket] | [Error, null]
244
-
245
- type connector = connectorAsync | connectorSync
246
-
247
- interface connectorSync {
248
- (options: buildConnector.Options): Socket_2 | TLSSocket
249
- }
260
+ type CallbackArgs = [null, Socket | TLSSocket] | [Error, null]
250
261
 
251
- interface connectorAsync {
262
+ interface connector {
252
263
  (options: buildConnector.Options, callback: buildConnector.Callback): void
253
264
  }
254
265
  }
@@ -266,7 +277,7 @@ declare class BundlerController extends Controller {
266
277
  emitBundleCompletetEvent(data: BundleCompleteEvent): void;
267
278
  on(event: "bundleStart", listener: (_: BundleStartEvent) => void): this;
268
279
  on(event: "bundleComplete", listener: (_: BundleCompleteEvent) => void): this;
269
- on(event: "error", listener: (_: ErrorEvent_2) => void): this;
280
+ on(event: "error", listener: (_: ErrorEvent) => void): this;
270
281
  once: typeof BundlerController.on;
271
282
  }
272
283
 
@@ -275,6 +286,82 @@ declare type BundleStartEvent = {
275
286
  config: StartDevWorkerOptions;
276
287
  };
277
288
 
289
+ declare interface Cache {
290
+ match (request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>,
291
+ matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Response[]>,
292
+ add (request: RequestInfo): Promise<undefined>,
293
+ addAll (requests: RequestInfo[]): Promise<undefined>,
294
+ put (request: RequestInfo, response: Response): Promise<undefined>,
295
+ delete (request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>,
296
+ keys (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Request[]>
297
+ }
298
+
299
+ /**
300
+ * No-op implementation of Cache
301
+ */
302
+ declare class Cache_2 {
303
+ delete(request: CacheRequest, options?: CacheQueryOptions_2): Promise<boolean>;
304
+ match(request: CacheRequest, options?: CacheQueryOptions_2): Promise<CacheResponse | undefined>;
305
+ put(request: CacheRequest, response: CacheResponse): Promise<void>;
306
+ }
307
+
308
+ declare interface CacheQueryOptions {
309
+ ignoreSearch?: boolean,
310
+ ignoreMethod?: boolean,
311
+ ignoreVary?: boolean
312
+ }
313
+
314
+ declare type CacheQueryOptions_2 = {
315
+ ignoreMethod?: boolean;
316
+ };
317
+
318
+ declare type CacheRequest = any;
319
+
320
+ declare type CacheResponse = any;
321
+
322
+ declare const caches: CacheStorage;
323
+
324
+ declare interface CacheStorage {
325
+ match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>,
326
+ has (cacheName: string): Promise<boolean>,
327
+ open (cacheName: string): Promise<Cache>,
328
+ delete (cacheName: string): Promise<boolean>,
329
+ keys (): Promise<string[]>
330
+ }
331
+
332
+ declare const CacheStorage: {
333
+ prototype: CacheStorage
334
+ new(): CacheStorage
335
+ };
336
+
337
+ /**
338
+ * Note about this file:
339
+ *
340
+ * Here we are providing a no-op implementation of the runtime Cache API instead of using
341
+ * the miniflare implementation (via `mf.getCaches()`).
342
+ *
343
+ * We are not using miniflare's implementation because that would require the user to provide
344
+ * miniflare-specific Request objects and they would receive back miniflare-specific Response
345
+ * objects, this (in particular the Request part) is not really suitable for `getPlatformProxy`
346
+ * as people would ideally interact with their bindings in a very production-like manner and
347
+ * requiring them to deal with miniflare-specific classes defeats a bit the purpose of the utility.
348
+ *
349
+ * Similarly the Request and Response types here are set to `undefined` as not to use specific ones
350
+ * that would require us to make a choice right now or the user to adapt their code in order to work
351
+ * with the api.
352
+ *
353
+ * We need to find a better/generic manner in which we can reuse the miniflare cache implementation,
354
+ * but until then the no-op implementation below will have to do.
355
+ */
356
+ /**
357
+ * No-op implementation of CacheStorage
358
+ */
359
+ declare class CacheStorage_2 {
360
+ constructor();
361
+ open(cacheName: string): Promise<Cache_2>;
362
+ get default(): Cache_2;
363
+ }
364
+
278
365
  /**
279
366
  * A Cloudflare account.
280
367
  */
@@ -291,6 +378,16 @@ declare interface CfAccount {
291
378
  accountId: string;
292
379
  }
293
380
 
381
+ /**
382
+ * A Durable Object.
383
+ */
384
+ declare interface CfDurableObject {
385
+ name: string;
386
+ class_name: string;
387
+ script_name?: string;
388
+ environment?: string;
389
+ }
390
+
294
391
  /**
295
392
  * An imported module.
296
393
  */
@@ -333,14 +430,16 @@ declare interface CfModule {
333
430
  /**
334
431
  * A module type.
335
432
  */
336
- declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer";
433
+ declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement";
337
434
 
338
435
  /**
339
436
  * The type of Worker
340
437
  */
341
438
  declare type CfScriptFormat = "modules" | "service-worker";
342
439
 
343
- /** A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default. */
440
+ /**
441
+ * A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
442
+ */
344
443
  declare class Client extends Dispatcher {
345
444
  constructor(url: string | URL_2, options?: Client.Options);
346
445
  /** Property to get and set the pipelining factor. */
@@ -352,39 +451,71 @@ declare class Client extends Dispatcher {
352
451
  }
353
452
 
354
453
  declare namespace Client {
454
+ interface OptionsInterceptors {
455
+ Client: readonly Dispatcher.DispatchInterceptor[];
456
+ }
355
457
  interface Options {
356
- /** the timeout after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. Default: `4e3` milliseconds (4s). */
357
- keepAliveTimeout?: number | null;
358
- /** the maximum allowed `idleTimeout` when overridden by *keep-alive* hints from the server. Default: `600e3` milliseconds (10min). */
359
- keepAliveMaxTimeout?: number | null;
360
- /** A number subtracted from server *keep-alive* hints when overriding `idleTimeout` to account for timing inaccuracies caused by e.g. transport latency. Default: `1e3` milliseconds (1s). */
361
- keepAliveTimeoutThreshold?: number | null;
362
- /** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Default: `1`. */
363
- pipelining?: number | null;
364
- /** **/
365
- connect?: buildConnector.BuildOptions | buildConnector.connector | null;
366
- /** The maximum length of request headers in bytes. Default: `16384` (16KiB). */
367
- maxHeaderSize?: number | null;
458
+ /** TODO */
459
+ interceptors?: OptionsInterceptors;
460
+ /** The maximum length of request headers in bytes. Default: Node.js' `--max-http-header-size` or `16384` (16KiB). */
461
+ maxHeaderSize?: number;
462
+ /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). */
463
+ headersTimeout?: number;
464
+ /** @deprecated unsupported socketTimeout, use headersTimeout & bodyTimeout instead */
465
+ socketTimeout?: never;
466
+ /** @deprecated unsupported requestTimeout, use headersTimeout & bodyTimeout instead */
467
+ requestTimeout?: never;
468
+ /** TODO */
469
+ connectTimeout?: number;
368
470
  /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Default: `300e3` milliseconds (300s). */
369
- bodyTimeout?: number | null;
370
- /** The amount of time the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). */
371
- headersTimeout?: number | null;
471
+ bodyTimeout?: number;
472
+ /** @deprecated unsupported idleTimeout, use keepAliveTimeout instead */
473
+ idleTimeout?: never;
474
+ /** @deprecated unsupported keepAlive, use pipelining=0 instead */
475
+ keepAlive?: never;
476
+ /** the timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. Default: `4e3` milliseconds (4s). */
477
+ keepAliveTimeout?: number;
478
+ /** @deprecated unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead */
479
+ maxKeepAliveTimeout?: never;
480
+ /** the maximum allowed `idleTimeout`, in milliseconds, when overridden by *keep-alive* hints from the server. Default: `600e3` milliseconds (10min). */
481
+ keepAliveMaxTimeout?: number;
482
+ /** A number of milliseconds subtracted from server *keep-alive* hints when overriding `idleTimeout` to account for timing inaccuracies caused by e.g. transport latency. Default: `1e3` milliseconds (1s). */
483
+ keepAliveTimeoutThreshold?: number;
484
+ /** TODO */
485
+ socketPath?: string;
486
+ /** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Default: `1`. */
487
+ pipelining?: number;
488
+ /** @deprecated use the connect option instead */
489
+ tls?: never;
372
490
  /** If `true`, an error is thrown when the request content-length header doesn't match the length of the request body. Default: `true`. */
373
491
  strictContentLength?: boolean;
374
- /** @deprecated use the connect option instead */
375
- tls?: TlsOptions_2 | null;
376
- /** */
492
+ /** TODO */
493
+ maxCachedSessions?: number;
494
+ /** TODO */
495
+ maxRedirections?: number;
496
+ /** TODO */
497
+ connect?: buildConnector.BuildOptions | buildConnector.connector;
498
+ /** TODO */
377
499
  maxRequestsPerClient?: number;
500
+ /** TODO */
501
+ localAddress?: string;
378
502
  /** Max response body size in bytes, -1 is disabled */
379
- maxResponseSize?: number | null;
503
+ maxResponseSize?: number;
380
504
  /** Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. */
381
505
  autoSelectFamily?: boolean;
382
506
  /** The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. */
383
507
  autoSelectFamilyAttemptTimeout?: number;
384
-
385
- interceptors?: {Client: readonly Dispatcher[] | undefined}
508
+ /**
509
+ * @description Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation.
510
+ * @default false
511
+ */
512
+ allowH2?: boolean;
513
+ /**
514
+ * @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
515
+ * @default 100
516
+ */
517
+ maxConcurrentStreams?: number
386
518
  }
387
-
388
519
  interface SocketInfo {
389
520
  localAddress?: string
390
521
  localPort?: number
@@ -395,27 +526,33 @@ declare namespace Client {
395
526
  bytesWritten?: number
396
527
  bytesRead?: number
397
528
  }
398
-
399
-
400
529
  }
401
530
 
402
- declare interface CloseEvent_2 extends Event_2 {
531
+ declare interface CloseEvent extends Event_2 {
403
532
  readonly code: number
404
533
  readonly reason: string
405
534
  readonly wasClean: boolean
406
535
  }
407
536
 
408
- declare const CloseEvent_2: {
409
- prototype: CloseEvent_2
410
- new (type: string, eventInitDict?: CloseEventInit_2): CloseEvent_2
537
+ declare const CloseEvent: {
538
+ prototype: CloseEvent
539
+ new (type: string, eventInitDict?: CloseEventInit): CloseEvent
411
540
  };
412
541
 
413
- declare interface CloseEventInit_2 extends EventInit_2 {
542
+ declare interface CloseEventInit extends EventInit {
414
543
  code?: number
415
544
  reason?: string
416
545
  wasClean?: boolean
417
546
  }
418
547
 
548
+ /**
549
+ * Configuration in wrangler for Cloudchamber
550
+ */
551
+ declare type CloudchamberConfig = {
552
+ vcpu?: number;
553
+ memory?: string;
554
+ };
555
+
419
556
  declare class ConfigController extends EventEmitter_2 {
420
557
  config?: StartDevWorkerOptions;
421
558
  setOptions(_: StartDevWorkerOptions): void;
@@ -423,7 +560,7 @@ declare class ConfigController extends EventEmitter_2 {
423
560
  teardown(): Promise<void>;
424
561
  emitConfigUpdateEvent(data: ConfigUpdateEvent): void;
425
562
  on(event: "configUpdate", listener: (_: ConfigUpdateEvent) => void): this;
426
- on(event: "error", listener: (_: ErrorEvent_2) => void): this;
563
+ on(event: "error", listener: (_: ErrorEvent) => void): this;
427
564
  once: typeof ConfigController.on;
428
565
  }
429
566
 
@@ -454,7 +591,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
454
591
  *
455
592
  * More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
456
593
  *
457
- * @default `[]`
594
+ * @default []
458
595
  */
459
596
  migrations: {
460
597
  /** A unique identifier for this migration. */
@@ -498,7 +635,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
498
635
  * items will be uploaded. Example: include = ["upload_dir"]
499
636
  *
500
637
  * @optional
501
- * @default `[]`
638
+ * @default []
502
639
  */
503
640
  include?: string[];
504
641
  /**
@@ -507,7 +644,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
507
644
  * uploads. Example: exclude = ["ignore_dir"]
508
645
  *
509
646
  * @optional
510
- * @default `[]`
647
+ * @default []
511
648
  */
512
649
  exclude?: string[];
513
650
  } | undefined;
@@ -562,7 +699,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
562
699
  /**
563
700
  * The possible types for a `Rule`.
564
701
  */
565
- declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data";
702
+ declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
566
703
 
567
704
  declare type ConfigUpdateEvent = {
568
705
  type: "configUpdate";
@@ -609,7 +746,7 @@ declare type DeferredPromise<T> = {
609
746
  };
610
747
 
611
748
  declare function deleteCookie (
612
- headers: Headers_2,
749
+ headers: Headers,
613
750
  name: string,
614
751
  attributes?: { name?: string, domain?: string }
615
752
  ): void
@@ -619,10 +756,10 @@ attributes?: { name?: string, domain?: string }
619
756
  * NOTE: You will need the `CLOUDFLARE_API_KEY` environment
620
757
  * variable set
621
758
  */
622
- declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, }: PagesDeployOptions): Promise<{
759
+ declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, args, }: PagesDeployOptions): Promise<{
623
760
  url: string;
624
- environment: "production" | "preview";
625
761
  id: string;
762
+ environment: "production" | "preview";
626
763
  project_id: string;
627
764
  project_name: string;
628
765
  build_config: {
@@ -661,7 +798,6 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
661
798
  build_image_major_version: number;
662
799
  kv_namespaces?: any;
663
800
  source?: {
664
- type: "github" | "gitlab";
665
801
  config: {
666
802
  owner: string;
667
803
  repo_name: string;
@@ -673,6 +809,7 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
673
809
  preview_branch_includes?: string[] | undefined;
674
810
  preview_branch_excludes?: string[] | undefined;
675
811
  };
812
+ type: "github" | "gitlab";
676
813
  } | undefined;
677
814
  env_vars?: any;
678
815
  durable_object_namespaces?: any;
@@ -741,35 +878,34 @@ declare interface DevConfig {
741
878
  /**
742
879
  * IP address for the local dev server to listen on,
743
880
  *
744
- * @default `localhost`
881
+ * @default localhost
745
882
  */
746
883
  ip: string;
747
884
  /**
748
885
  * Port for the local dev server to listen on
749
886
  *
750
- * @default `8787`
887
+ * @default 8787
751
888
  */
752
889
  port: number | undefined;
753
890
  /**
754
891
  * Port for the local dev server's inspector to listen on
755
892
  *
756
- * @default `9229`
893
+ * @default 9229
757
894
  */
758
895
  inspector_port: number | undefined;
759
896
  /**
760
897
  * Protocol that local wrangler dev server listens to requests on.
761
898
  *
762
- * @default `http`
899
+ * @default http
763
900
  */
764
901
  local_protocol: "http" | "https";
765
902
  /**
766
903
  * Protocol that wrangler dev forwards requests on
767
904
  *
768
- * Setting this to `http` is not currently implemented.
905
+ * Setting this to `http` is not currently implemented for remote mode.
769
906
  * See https://github.com/cloudflare/workers-sdk/issues/583
770
907
  *
771
- * @default `https`
772
- * @todo this needs to be implemented https://github.com/cloudflare/workers-sdk/issues/583
908
+ * @default https
773
909
  */
774
910
  upstream_protocol: "https" | "http";
775
911
  /**
@@ -838,20 +974,20 @@ declare namespace DiagnosticsChannel {
838
974
  interface ClientSendHeadersMessage {
839
975
  request: Request;
840
976
  headers: string;
841
- socket: Socket_2;
977
+ socket: Socket;
842
978
  }
843
979
  interface ClientBeforeConnectMessage {
844
980
  connectParams: ConnectParams;
845
981
  connector: Connector;
846
982
  }
847
983
  interface ClientConnectedMessage {
848
- socket: Socket_2;
984
+ socket: Socket;
849
985
  connectParams: ConnectParams;
850
986
  connector: Connector;
851
987
  }
852
988
  interface ClientConnectErrorMessage {
853
989
  error: Error;
854
- socket: Socket_2;
990
+ socket: Socket;
855
991
  connectParams: ConnectParams;
856
992
  connector: Connector;
857
993
  }
@@ -944,7 +1080,7 @@ declare namespace Dispatcher {
944
1080
  path: string;
945
1081
  method: HttpMethod;
946
1082
  /** Default: `null` */
947
- body?: string | Buffer | Uint8Array | Readable | null | FormData_2;
1083
+ body?: string | Buffer | Uint8Array | Readable | null | FormData;
948
1084
  /** Default: `null` */
949
1085
  headers?: IncomingHttpHeaders | string[] | null;
950
1086
  /** Query string params to be embedded in the request URL. Default: `null` */
@@ -955,7 +1091,7 @@ declare namespace Dispatcher {
955
1091
  blocking?: boolean;
956
1092
  /** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */
957
1093
  upgrade?: boolean | string | null;
958
- /** The amount of time the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */
1094
+ /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */
959
1095
  headersTimeout?: number | null;
960
1096
  /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Defaults to 300 seconds. */
961
1097
  bodyTimeout?: number | null;
@@ -963,6 +1099,8 @@ declare namespace Dispatcher {
963
1099
  reset?: boolean;
964
1100
  /** Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false */
965
1101
  throwOnError?: boolean;
1102
+ /** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server*/
1103
+ expectContinue?: boolean;
966
1104
  }
967
1105
  interface ConnectOptions {
968
1106
  path: string;
@@ -988,6 +1126,8 @@ declare namespace Dispatcher {
988
1126
  onInfo?: (info: { statusCode: number, headers: Record<string, string | string[]> }) => void;
989
1127
  /** Default: `null` */
990
1128
  responseHeader?: 'raw' | null;
1129
+ /** Default: `64 KiB` */
1130
+ highWaterMark?: number;
991
1131
  }
992
1132
  interface PipelineOptions extends RequestOptions {
993
1133
  /** `true` if the `handler` will return an object stream. Default: `false` */
@@ -1053,7 +1193,7 @@ declare namespace Dispatcher {
1053
1193
  /** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */
1054
1194
  onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void;
1055
1195
  /** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */
1056
- onHeaders?(statusCode: number, headers: Buffer[] | string[] | null, resume: () => void): boolean;
1196
+ onHeaders?(statusCode: number, headers: Buffer[] | string[] | null, resume: () => void, statusText: string): boolean;
1057
1197
  /** Invoked when response payload data is received. */
1058
1198
  onData?(chunk: Buffer): boolean;
1059
1199
  /** Invoked when response payload and trailers have been received and the request has completed. */
@@ -1073,7 +1213,7 @@ declare namespace Dispatcher {
1073
1213
  arrayBuffer(): Promise<ArrayBuffer>;
1074
1214
  blob(): Promise<Blob_2>;
1075
1215
  formData(): Promise<never>;
1076
- json(): Promise<any>;
1216
+ json(): Promise<unknown>;
1077
1217
  text(): Promise<string>;
1078
1218
  }
1079
1219
 
@@ -1091,7 +1231,7 @@ declare interface DispatchNamespaceOutbound {
1091
1231
  parameters?: string[];
1092
1232
  }
1093
1233
 
1094
- declare type DOMException_2 = typeof globalThis extends { DOMException: infer T }
1234
+ declare type DOMException = typeof globalThis extends { DOMException: infer T }
1095
1235
  ? T
1096
1236
  : any
1097
1237
 
@@ -1224,6 +1364,13 @@ declare interface EnvironmentInheritable {
1224
1364
  * @inheritable
1225
1365
  */
1226
1366
  find_additional_modules: boolean | undefined;
1367
+ /**
1368
+ * Determines whether Wrangler will preserve bundled file names.
1369
+ * Defaults to false.
1370
+ * If left unset, files will be named using the pattern ${fileHash}-${basename},
1371
+ * for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
1372
+ */
1373
+ preserve_file_names: boolean | undefined;
1227
1374
  /**
1228
1375
  * The directory in which module rules should be evaluated when including additional files into a worker deployment.
1229
1376
  * This defaults to the directory containing the `main` entry point of the worker if not specified.
@@ -1354,23 +1501,6 @@ declare interface EnvironmentInheritable {
1354
1501
  * @inheritable
1355
1502
  */
1356
1503
  node_compat: boolean | undefined;
1357
- /**
1358
- * Specifies namespace bindings that are bound to this Worker environment.
1359
- *
1360
- * NOTE: This field is not automatically inherited from the top level environment,
1361
- * and so must be specified in every named environment.
1362
- *
1363
- * @default `[]`
1364
- * @nonInheritable
1365
- */
1366
- dispatch_namespaces: {
1367
- /** The binding name used to refer to the bound service. */
1368
- binding: string;
1369
- /** The namespace to bind to. */
1370
- namespace: string;
1371
- /** Details about the outbound worker which will handle outbound requests from your namespace */
1372
- outbound?: DispatchNamespaceOutbound;
1373
- }[];
1374
1504
  /**
1375
1505
  * Designates this worker as an internal-only "first-party" worker.
1376
1506
  */
@@ -1407,6 +1537,11 @@ declare interface EnvironmentInheritable {
1407
1537
  * @inheritable
1408
1538
  */
1409
1539
  logpush: boolean | undefined;
1540
+ /**
1541
+ * Include source maps when uploading this worker.
1542
+ * @inheritable
1543
+ */
1544
+ upload_source_maps: boolean | undefined;
1410
1545
  /**
1411
1546
  * Specify how the worker should be located to minimize round-trip time.
1412
1547
  *
@@ -1428,7 +1563,7 @@ declare interface EnvironmentMap {
1428
1563
  *
1429
1564
  * For more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments
1430
1565
  *
1431
- * @default `{}`
1566
+ * @default {}
1432
1567
  */
1433
1568
  env?: {
1434
1569
  [envName: string]: RawEnvironment;
@@ -1463,6 +1598,18 @@ declare interface EnvironmentNonInheritable {
1463
1598
  * @nonInheritable
1464
1599
  */
1465
1600
  vars: Record<string, string | Json>;
1601
+ /**
1602
+ * The dispatch namespace that your worker should belongs to.
1603
+ *
1604
+ * For more information about dispatch namespaces, see https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/
1605
+ *
1606
+ * NOTE: This field is not automatically inherited from the top level environment,
1607
+ * and so must be specified in every named environment.
1608
+ *
1609
+ * @default `undefined`
1610
+ * @nonInheritable
1611
+ */
1612
+ dispatch_namespace: string | undefined;
1466
1613
  /**
1467
1614
  * A list of durable objects that your worker should be bound to.
1468
1615
  *
@@ -1478,6 +1625,16 @@ declare interface EnvironmentNonInheritable {
1478
1625
  durable_objects: {
1479
1626
  bindings: DurableObjectBindings;
1480
1627
  };
1628
+ /**
1629
+ * Cloudchamber configuration
1630
+ *
1631
+ * NOTE: This field is not automatically inherited from the top level environment,
1632
+ * and so must be specified in every named environment.
1633
+ *
1634
+ * @default `{}`
1635
+ * @nonInheritable
1636
+ */
1637
+ cloudchamber: CloudchamberConfig;
1481
1638
  /**
1482
1639
  * These specify any Workers KV Namespaces you want to
1483
1640
  * access from inside your Worker.
@@ -1532,11 +1689,15 @@ declare interface EnvironmentNonInheritable {
1532
1689
  binding: string;
1533
1690
  /** The name of this Queue. */
1534
1691
  queue: string;
1692
+ /** The number of seconds to wait before delivering a message */
1693
+ delivery_delay?: number;
1535
1694
  }[];
1536
1695
  /** Consumer configuration */
1537
1696
  consumers?: {
1538
- /** The name of the queue from which this script should consume. */
1697
+ /** The name of the queue from which this consumer should consume. */
1539
1698
  queue: string;
1699
+ /** The consumer type, e.g., worker, http-pull, r2-bucket, etc. Default is worker. */
1700
+ type?: string;
1540
1701
  /** The maximum number of messages per batch */
1541
1702
  max_batch_size?: number;
1542
1703
  /** The maximum number of seconds to wait to fill a batch with messages. */
@@ -1547,6 +1708,10 @@ declare interface EnvironmentNonInheritable {
1547
1708
  dead_letter_queue?: string;
1548
1709
  /** The maximum number of concurrent consumer Worker invocations. Leaving this unset will allow your consumer to scale to the maximum concurrency needed to keep up with the message backlog. */
1549
1710
  max_concurrency?: number | null;
1711
+ /** The number of milliseconds to wait for pulled messages to become visible again */
1712
+ visibility_timeout_ms?: number;
1713
+ /** The number of seconds to wait before retrying a message */
1714
+ retry_delay?: number;
1550
1715
  }[];
1551
1716
  };
1552
1717
  /**
@@ -1656,7 +1821,26 @@ declare interface EnvironmentNonInheritable {
1656
1821
  service: string;
1657
1822
  /** The environment of the service (e.g. production, staging, etc). */
1658
1823
  environment?: string;
1824
+ /** Optionally, the entrypoint (named export) of the service to bind to. */
1825
+ entrypoint?: string;
1659
1826
  }[] | undefined;
1827
+ /**
1828
+ * Specifies namespace bindings that are bound to this Worker environment.
1829
+ *
1830
+ * NOTE: This field is not automatically inherited from the top level environment,
1831
+ * and so must be specified in every named environment.
1832
+ *
1833
+ * @default `[]`
1834
+ * @nonInheritable
1835
+ */
1836
+ dispatch_namespaces: {
1837
+ /** The binding name used to refer to the bound service. */
1838
+ binding: string;
1839
+ /** The namespace to bind to. */
1840
+ namespace: string;
1841
+ /** Details about the outbound worker which will handle outbound requests from your namespace */
1842
+ outbound?: DispatchNamespaceOutbound;
1843
+ }[];
1660
1844
  /**
1661
1845
  * Specifies analytics engine datasets that are bound to this Worker environment.
1662
1846
  *
@@ -1684,6 +1868,12 @@ declare interface EnvironmentNonInheritable {
1684
1868
  ai: {
1685
1869
  binding: string;
1686
1870
  } | undefined;
1871
+ /**
1872
+ * Binding to the Worker Version's metadata
1873
+ */
1874
+ version_metadata: {
1875
+ binding: string;
1876
+ } | undefined;
1687
1877
  /**
1688
1878
  * "Unsafe" tables for features that aren't directly supported by wrangler.
1689
1879
  *
@@ -1708,7 +1898,7 @@ declare interface EnvironmentNonInheritable {
1708
1898
  * here will always be applied to metadata last, so can add new or override existing fields.
1709
1899
  */
1710
1900
  metadata?: {
1711
- [key: string]: string;
1901
+ [key: string]: unknown;
1712
1902
  };
1713
1903
  /**
1714
1904
  * Used for internal capnp uploads for the Workers runtime
@@ -1732,13 +1922,16 @@ declare interface EnvironmentNonInheritable {
1732
1922
  tail_consumers?: TailConsumer[];
1733
1923
  }
1734
1924
 
1735
- declare type ErrorEvent_2 = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker"> | BaseErrorEvent<"ProxyController", {
1925
+ declare type ErrorEvent = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker"> | BaseErrorEvent<"ProxyController", {
1736
1926
  config?: StartDevWorkerOptions;
1737
1927
  bundle?: EsbuildBundle;
1738
1928
  }>;
1739
1929
 
1740
1930
  declare namespace Errors {
1741
- class UndiciError extends Error { }
1931
+ class UndiciError extends Error {
1932
+ name: string;
1933
+ code: string;
1934
+ }
1742
1935
 
1743
1936
  /** Connect timeout error. */
1744
1937
  class ConnectTimeoutError extends UndiciError {
@@ -1765,6 +1958,12 @@ declare namespace Errors {
1765
1958
  }
1766
1959
 
1767
1960
  class ResponseStatusCodeError extends UndiciError {
1961
+ constructor (
1962
+ message?: string,
1963
+ statusCode?: number,
1964
+ headers?: IncomingHttpHeaders | string[] | null,
1965
+ body?: null | Record<string, any> | string
1966
+ );
1768
1967
  name: 'ResponseStatusCodeError';
1769
1968
  code: 'UND_ERR_RESPONSE_STATUS_CODE';
1770
1969
  body: null | Record<string, any> | string
@@ -1885,17 +2084,17 @@ declare type Event_2 = typeof globalThis extends { Event: infer T }
1885
2084
  readonly type: string
1886
2085
  }
1887
2086
 
1888
- declare interface EventInit_2 {
2087
+ declare interface EventInit {
1889
2088
  bubbles?: boolean
1890
2089
  cancelable?: boolean
1891
2090
  composed?: boolean
1892
2091
  }
1893
2092
 
1894
- declare interface EventListener_2 {
2093
+ declare interface EventListener {
1895
2094
  (evt: Event_2): void
1896
2095
  }
1897
2096
 
1898
- declare interface EventListenerObject_2 {
2097
+ declare interface EventListenerObject {
1899
2098
  handleEvent (object: Event_2): void
1900
2099
  }
1901
2100
 
@@ -1903,7 +2102,7 @@ declare interface EventListenerOptions {
1903
2102
  capture?: boolean
1904
2103
  }
1905
2104
 
1906
- declare type EventListenerOrEventListenerObject_2 = EventListener_2 | EventListenerObject_2
2105
+ declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject
1907
2106
 
1908
2107
  declare type _EventMethods = keyof ProtocolMapping.Events;
1909
2108
 
@@ -1923,12 +2122,17 @@ declare type EventTarget_2 = typeof globalThis extends { EventTarget: infer T }
1923
2122
  ): void
1924
2123
  }
1925
2124
 
1926
- declare function fetch_2 (
1927
- input: RequestInfo_2,
1928
- init?: RequestInit_2
1929
- ): Promise<Response_2>
2125
+ declare class ExecutionContext {
2126
+ waitUntil(promise: Promise<any>): void;
2127
+ passThroughOnException(): void;
2128
+ }
2129
+
2130
+ declare function fetch (
2131
+ input: RequestInfo,
2132
+ init?: RequestInit
2133
+ ): Promise<Response>
1930
2134
 
1931
- declare class File_2 extends Blob_2 {
2135
+ declare class File extends Blob_2 {
1932
2136
  /**
1933
2137
  * Creates a new File instance.
1934
2138
  *
@@ -1951,7 +2155,7 @@ declare class File_2 extends Blob_2 {
1951
2155
  readonly [Symbol.toStringTag]: string
1952
2156
  }
1953
2157
 
1954
- declare type File_3<Contents = string> = {
2158
+ declare type File_2<Contents = string> = {
1955
2159
  path: string;
1956
2160
  } | {
1957
2161
  contents: Contents;
@@ -1989,7 +2193,7 @@ declare class FileReader {
1989
2193
 
1990
2194
  readonly result: string | ArrayBuffer | null
1991
2195
 
1992
- readonly error: DOMException_2 | null
2196
+ readonly error: DOMException | null
1993
2197
 
1994
2198
  onloadstart: null | ((this: FileReader, event: ProgressEvent) => void)
1995
2199
  onprogress: null | ((this: FileReader, event: ProgressEvent) => void)
@@ -2002,7 +2206,7 @@ declare class FileReader {
2002
2206
  /**
2003
2207
  * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch().
2004
2208
  */
2005
- declare class FormData_2 {
2209
+ declare class FormData {
2006
2210
  /**
2007
2211
  * Appends a new value onto an existing key inside a FormData object,
2008
2212
  * or adds the key if it does not already exist.
@@ -2067,7 +2271,7 @@ declare class FormData_2 {
2067
2271
  * Executes given callback function for each field of the FormData instance
2068
2272
  */
2069
2273
  forEach: (
2070
- callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData_2) => void,
2274
+ callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void,
2071
2275
  thisArg?: unknown
2072
2276
  ) => void
2073
2277
 
@@ -2100,18 +2304,67 @@ declare class FormData_2 {
2100
2304
  /**
2101
2305
  * A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
2102
2306
  */
2103
- declare type FormDataEntryValue = string | File_2
2307
+ declare type FormDataEntryValue = string | File
2104
2308
 
2105
- declare function getCookies (headers: Headers_2): Record<string, string>
2309
+ /**
2310
+ * By reading from a `wrangler.toml` file this function generates proxy binding objects that can be
2311
+ * used to simulate the interaction with bindings during local development in a Node.js environment
2312
+ *
2313
+ * @deprecated use `getPlatformProxy` instead
2314
+ *
2315
+ * @param options The various options that can tweak this function's behavior
2316
+ * @returns An Object containing the generated proxies alongside other related utilities
2317
+ */
2318
+ export declare function getBindingsProxy<Bindings = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties>(options?: GetBindingsProxyOptions): Promise<BindingsProxy<Bindings, CfProperties>>;
2319
+
2320
+ /** Options for the `getBindingsProxy` utility */
2321
+ export declare type GetBindingsProxyOptions = GetPlatformProxyOptions;
2322
+
2323
+ declare function getCookies (headers: Headers): Record<string, string>
2106
2324
 
2107
2325
  declare function getGlobalDispatcher(): Dispatcher;
2108
2326
 
2109
2327
  declare function getGlobalOrigin(): URL | undefined;
2110
2328
 
2111
- declare function getSetCookies (headers: Headers_2): Cookie[]
2329
+ /**
2330
+ * By reading from a `wrangler.toml` file this function generates proxy objects that can be
2331
+ * used to simulate the interaction with the Cloudflare platform during local development
2332
+ * in a Node.js environment
2333
+ *
2334
+ * @param options The various options that can tweak this function's behavior
2335
+ * @returns An Object containing the generated proxies alongside other related utilities
2336
+ */
2337
+ export declare function getPlatformProxy<Env = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties>(options?: GetPlatformProxyOptions): Promise<PlatformProxy<Env, CfProperties>>;
2338
+
2339
+ /**
2340
+ * Options for the `getPlatformProxy` utility
2341
+ */
2342
+ export declare type GetPlatformProxyOptions = {
2343
+ /**
2344
+ * The path to the config object to use (default `wrangler.toml`)
2345
+ */
2346
+ configPath?: string;
2347
+ /**
2348
+ * Flag to indicate the utility to read a json config file (`wrangler.json`)
2349
+ * instead of the toml one (`wrangler.toml`)
2350
+ *
2351
+ * Note: this feature is experimental
2352
+ */
2353
+ experimentalJsonConfig?: boolean;
2354
+ /**
2355
+ * Indicates if and where to persist the bindings data, if not present or `true` it defaults to the same location
2356
+ * used by wrangler v3: `.wrangler/state/v3` (so that the same data can be easily used by the caller and wrangler).
2357
+ * If `false` is specified no data is persisted on the filesystem.
2358
+ */
2359
+ persist?: boolean | {
2360
+ path: string;
2361
+ };
2362
+ };
2363
+
2364
+ declare function getSetCookies (headers: Headers): Cookie[]
2112
2365
 
2113
- declare class Headers_2 implements SpecIterable<[string, string]> {
2114
- constructor (init?: HeadersInit_2)
2366
+ declare class Headers implements SpecIterable<[string, string]> {
2367
+ constructor (init?: HeadersInit)
2115
2368
  readonly append: (name: string, value: string) => void
2116
2369
  readonly delete: (name: string) => void
2117
2370
  readonly get: (name: string) => string | null
@@ -2119,7 +2372,7 @@ declare class Headers_2 implements SpecIterable<[string, string]> {
2119
2372
  readonly set: (name: string, value: string) => void
2120
2373
  readonly getSetCookie: () => string[]
2121
2374
  readonly forEach: (
2122
- callbackfn: (value: string, key: string, iterable: Headers_2) => void,
2375
+ callbackfn: (value: string, key: string, iterable: Headers) => void,
2123
2376
  thisArg?: unknown
2124
2377
  ) => void
2125
2378
 
@@ -2129,10 +2382,17 @@ declare class Headers_2 implements SpecIterable<[string, string]> {
2129
2382
  readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
2130
2383
  }
2131
2384
 
2132
- declare type HeadersInit_2 = string[][] | Record<string, string | ReadonlyArray<string>> | Headers_2
2385
+ declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers
2133
2386
 
2134
2387
  declare type Hook<T, Args extends unknown[] = unknown[]> = T | Promise<T> | ((...args: Args) => T | Promise<T>);
2135
2388
 
2389
+ /**
2390
+ * @property terminate Terminates HTTP server.
2391
+ */
2392
+ declare type HttpTerminator = {
2393
+ readonly terminate: () => Promise<void>;
2394
+ };
2395
+
2136
2396
  /**
2137
2397
  * The header type declaration of `undici`.
2138
2398
  */
@@ -2170,12 +2430,12 @@ declare type LogLevel = "debug" | "info" | "log" | "warn" | "error" | "none";
2170
2430
 
2171
2431
  declare type MaybePromise<T> = T | Promise<T>;
2172
2432
 
2173
- declare interface MessageEvent_2<T = any> extends Event_2 {
2433
+ declare interface MessageEvent<T = any> extends Event_2 {
2174
2434
  readonly data: T
2175
2435
  readonly lastEventId: string
2176
2436
  readonly origin: string
2177
- readonly ports: ReadonlyArray<typeof MessagePort>
2178
- readonly source: typeof MessagePort | null
2437
+ readonly ports: ReadonlyArray<typeof MessagePort_2>
2438
+ readonly source: typeof MessagePort_2 | null
2179
2439
  initMessageEvent(
2180
2440
  type: string,
2181
2441
  bubbles?: boolean,
@@ -2183,22 +2443,22 @@ declare interface MessageEvent_2<T = any> extends Event_2 {
2183
2443
  data?: any,
2184
2444
  origin?: string,
2185
2445
  lastEventId?: string,
2186
- source?: typeof MessagePort | null,
2187
- ports?: (typeof MessagePort)[]
2446
+ source?: typeof MessagePort_2 | null,
2447
+ ports?: (typeof MessagePort_2)[]
2188
2448
  ): void;
2189
2449
  }
2190
2450
 
2191
- declare const MessageEvent_2: {
2192
- prototype: MessageEvent_2
2193
- new<T>(type: string, eventInitDict?: MessageEventInit_2<T>): MessageEvent_2<T>
2451
+ declare const MessageEvent: {
2452
+ prototype: MessageEvent
2453
+ new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>
2194
2454
  };
2195
2455
 
2196
- declare interface MessageEventInit_2<T = any> extends EventInit_2 {
2456
+ declare interface MessageEventInit<T = any> extends EventInit {
2197
2457
  data?: T
2198
2458
  lastEventId?: string
2199
2459
  origin?: string
2200
- ports?: (typeof MessagePort)[]
2201
- source?: typeof MessagePort | null
2460
+ ports?: (typeof MessagePort_2)[]
2461
+ source?: typeof MessagePort_2 | null
2202
2462
  }
2203
2463
 
2204
2464
  declare interface MIMEType {
@@ -2326,8 +2586,8 @@ declare namespace MockInterceptor {
2326
2586
  path: string;
2327
2587
  origin: string;
2328
2588
  method: string;
2329
- body?: BodyInit_2 | Dispatcher.DispatchOptions['body'];
2330
- headers: Headers_2 | Record<string, string>;
2589
+ body?: BodyInit | Dispatcher.DispatchOptions['body'];
2590
+ headers: Headers | Record<string, string>;
2331
2591
  maxRedirections: number;
2332
2592
  }
2333
2593
 
@@ -2376,6 +2636,32 @@ declare interface ModuleRule {
2376
2636
  fallthrough?: boolean;
2377
2637
  }
2378
2638
 
2639
+ declare interface MultiCacheQueryOptions extends CacheQueryOptions {
2640
+ cacheName?: string
2641
+ }
2642
+
2643
+ declare interface PagesConfigFields {
2644
+ /**
2645
+ * The directory of static assets to serve.
2646
+ *
2647
+ * The presence of this field in `wrangler.toml` indicates a Pages project,
2648
+ * and will prompt the handling of the configuration file according to the
2649
+ * Pages-specific validation rules.
2650
+ */
2651
+ pages_build_output_dir?: string;
2652
+ }
2653
+
2654
+ declare interface PagesConfigFields {
2655
+ /**
2656
+ * The directory of static assets to serve.
2657
+ *
2658
+ * The presence of this field in `wrangler.toml` indicates a Pages project,
2659
+ * and will prompt the handling of the configuration file according to the
2660
+ * Pages-specific validation rules.
2661
+ */
2662
+ pages_build_output_dir?: string;
2663
+ }
2664
+
2379
2665
  declare interface PagesDeployOptions {
2380
2666
  /**
2381
2667
  * Path to static assets to deploy to Pages
@@ -2422,6 +2708,10 @@ declare interface PagesDeployOptions {
2422
2708
  * Default: true
2423
2709
  */
2424
2710
  bundle?: boolean;
2711
+ /**
2712
+ * Command line args passed to the `pages deploy` cmd
2713
+ */
2714
+ args?: Record<string, unknown>;
2425
2715
  }
2426
2716
 
2427
2717
  declare type _Params<ParamsArray extends [unknown?]> = ParamsArray extends [infer P] ? P : undefined;
@@ -2448,6 +2738,32 @@ options: { dispatcher?: Dispatcher } & Omit<Dispatcher.PipelineOptions, 'origin'
2448
2738
  handler: Dispatcher.PipelineHandler
2449
2739
  ): Duplex;
2450
2740
 
2741
+ /**
2742
+ * Result of the `getPlatformProxy` utility
2743
+ */
2744
+ export declare type PlatformProxy<Env = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties> = {
2745
+ /**
2746
+ * Environment object containing the various Cloudflare bindings
2747
+ */
2748
+ env: Env;
2749
+ /**
2750
+ * Mock of the context object that Workers received in their request handler, all the object's methods are no-op
2751
+ */
2752
+ cf: CfProperties;
2753
+ /**
2754
+ * Mock of the context object that Workers received in their request handler, all the object's methods are no-op
2755
+ */
2756
+ ctx: ExecutionContext;
2757
+ /**
2758
+ * Caches object emulating the Workers Cache runtime API
2759
+ */
2760
+ caches: CacheStorage_2;
2761
+ /**
2762
+ * Function used to dispose of the child process providing the bindings implementation
2763
+ */
2764
+ dispose: () => Promise<void>;
2765
+ };
2766
+
2451
2767
  declare class Pool extends Dispatcher {
2452
2768
  constructor(url: string | URL_2, options?: Pool.Options)
2453
2769
  /** `true` after `pool.close()` has been called. */
@@ -2501,7 +2817,7 @@ declare class ProgressEvent {
2501
2817
  readonly total: number
2502
2818
  }
2503
2819
 
2504
- declare interface ProgressEventInit extends EventInit_2 {
2820
+ declare interface ProgressEventInit extends EventInit {
2505
2821
  lengthComputable?: boolean
2506
2822
  loaded?: number
2507
2823
  total?: number
@@ -22767,6 +23083,7 @@ declare namespace ProxyAgent {
22767
23083
  headers?: IncomingHttpHeaders;
22768
23084
  requestTls?: buildConnector.BuildOptions;
22769
23085
  proxyTls?: buildConnector.BuildOptions;
23086
+ clientFactory?(origin: URL, opts: object): Dispatcher;
22770
23087
  }
22771
23088
  }
22772
23089
 
@@ -22774,12 +23091,12 @@ declare class ProxyController extends EventEmitter_2 {
22774
23091
  ready: DeferredPromise<ReadyEvent>;
22775
23092
  proxyWorker?: Miniflare;
22776
23093
  proxyWorkerOptions?: MiniflareOptions;
22777
- inspectorProxyWorkerWebSocket?: DeferredPromise<WebSocket_3>;
23094
+ inspectorProxyWorkerWebSocket?: DeferredPromise<WebSocket_2>;
22778
23095
  protected latestConfig?: StartDevWorkerOptions;
22779
23096
  protected latestBundle?: EsbuildBundle;
22780
23097
  secret: `${string}-${string}-${string}-${string}-${string}`;
22781
23098
  protected createProxyWorker(): void;
22782
- reconnectInspectorProxyWorker(): Promise<WebSocket_3 | undefined>;
23099
+ reconnectInspectorProxyWorker(): Promise<WebSocket_2 | undefined>;
22783
23100
  runtimeMessageMutex: Mutex;
22784
23101
  sendMessageToProxyWorker(message: ProxyWorkerIncomingRequestBody, retries?: number): Promise<void>;
22785
23102
  sendMessageToInspectorProxyWorker(message: InspectorProxyWorkerIncomingWebSocketMessage, retries?: number): Promise<void>;
@@ -22789,7 +23106,7 @@ declare class ProxyController extends EventEmitter_2 {
22789
23106
  onReloadComplete(data: ReloadCompleteEvent): void;
22790
23107
  onProxyWorkerMessage(message: ProxyWorkerOutgoingRequestBody): void;
22791
23108
  onInspectorProxyWorkerMessage(message: InspectorProxyWorkerOutgoingWebsocketMessage): void;
22792
- onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<Response_3>;
23109
+ onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<Response_2>;
22793
23110
  _torndown: boolean;
22794
23111
  teardown(): Promise<void>;
22795
23112
  emitReadyEvent(proxyWorker: Miniflare): void;
@@ -22797,7 +23114,7 @@ declare class ProxyController extends EventEmitter_2 {
22797
23114
  emitErrorEvent(reason: string, cause: Error | SerializedError): void;
22798
23115
  on(event: "ready", listener: (_: ReadyEvent) => void): this;
22799
23116
  on(event: "previewTokenExpired", listener: (_: PreviewTokenExpiredEvent) => void): this;
22800
- on(event: "error", listener: (_: ErrorEvent_2) => void): this;
23117
+ on(event: "error", listener: (_: ErrorEvent) => void): this;
22801
23118
  once: typeof ProxyController.on;
22802
23119
  }
22803
23120
 
@@ -22805,9 +23122,11 @@ declare type ProxyData = {
22805
23122
  userWorkerUrl: UrlOriginParts;
22806
23123
  userWorkerInspectorUrl: UrlOriginAndPathnameParts;
22807
23124
  userWorkerInnerUrlOverrides: Partial<UrlOriginParts>;
22808
- headers: Record<string, string | undefined>;
23125
+ headers: Record<string, string>;
22809
23126
  liveReload?: boolean;
22810
23127
  proxyLogsToController?: boolean;
23128
+ internalDurableObjects?: CfDurableObject[];
23129
+ entrypointAddresses: WorkerEntrypointsDefinition | undefined;
22811
23130
  };
22812
23131
 
22813
23132
  declare type ProxyWorkerIncomingRequestBody = {
@@ -22828,7 +23147,9 @@ declare type ProxyWorkerOutgoingRequestBody = {
22828
23147
  args: Parameters<typeof console.debug>;
22829
23148
  };
22830
23149
 
22831
- declare type RawConfig = Partial<ConfigFields<RawDevConfig>> & RawEnvironment & DeprecatedConfigFields & EnvironmentMap;
23150
+ declare type RawConfig = Partial<ConfigFields<RawDevConfig>> & PagesConfigFields & RawEnvironment & DeprecatedConfigFields & EnvironmentMap & {
23151
+ $schema?: string;
23152
+ };
22832
23153
 
22833
23154
  declare type RawDevConfig = Partial<DevConfig>;
22834
23155
 
@@ -22875,19 +23196,13 @@ declare type ReloadStartEvent = {
22875
23196
  bundle: EsbuildBundle;
22876
23197
  };
22877
23198
 
22878
- /** Performs an HTTP request. */
22879
- declare function request(
22880
- url: string | URL_2 | UrlObject,
22881
- options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
22882
- ): Promise<Dispatcher.ResponseData>;
22883
-
22884
- declare class Request_2 implements BodyMixin {
22885
- constructor (input: RequestInfo_2, init?: RequestInit_2)
23199
+ declare class Request implements BodyMixin {
23200
+ constructor (input: RequestInfo, init?: RequestInit)
22886
23201
 
22887
23202
  readonly cache: RequestCache
22888
23203
  readonly credentials: RequestCredentials
22889
23204
  readonly destination: RequestDestination
22890
- readonly headers: Headers_2
23205
+ readonly headers: Headers
22891
23206
  readonly integrity: string
22892
23207
  readonly method: string
22893
23208
  readonly mode: RequestMode
@@ -22899,18 +23214,24 @@ declare class Request_2 implements BodyMixin {
22899
23214
  readonly signal: AbortSignal
22900
23215
  readonly duplex: RequestDuplex
22901
23216
 
22902
- readonly body: ReadableStream_2 | null
23217
+ readonly body: ReadableStream | null
22903
23218
  readonly bodyUsed: boolean
22904
23219
 
22905
23220
  readonly arrayBuffer: () => Promise<ArrayBuffer>
22906
23221
  readonly blob: () => Promise<Blob_2>
22907
- readonly formData: () => Promise<FormData_2>
23222
+ readonly formData: () => Promise<FormData>
22908
23223
  readonly json: () => Promise<unknown>
22909
23224
  readonly text: () => Promise<string>
22910
23225
 
22911
- readonly clone: () => Request_2
23226
+ readonly clone: () => Request
22912
23227
  }
22913
23228
 
23229
+ /** Performs an HTTP request. */
23230
+ declare function request(
23231
+ url: string | URL_2 | UrlObject,
23232
+ options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
23233
+ ): Promise<Dispatcher.ResponseData>;
23234
+
22914
23235
  declare type RequestCache =
22915
23236
  | 'default'
22916
23237
  | 'force-cache'
@@ -22943,16 +23264,16 @@ declare type RequestDestination =
22943
23264
 
22944
23265
  declare type RequestDuplex = 'half'
22945
23266
 
22946
- declare type RequestInfo_2 = string | URL_2 | Request_2
23267
+ declare type RequestInfo = string | URL_2 | Request
22947
23268
 
22948
- declare interface RequestInit_2 {
23269
+ declare interface RequestInit {
22949
23270
  method?: string
22950
23271
  keepalive?: boolean
22951
- headers?: HeadersInit_2
22952
- body?: BodyInit_2
23272
+ headers?: HeadersInit
23273
+ body?: BodyInit
22953
23274
  redirect?: RequestRedirect
22954
23275
  integrity?: string
22955
- signal?: AbortSignal
23276
+ signal?: AbortSignal | null
22956
23277
  credentials?: RequestCredentials
22957
23278
  mode?: RequestMode
22958
23279
  referrer?: string
@@ -22966,10 +23287,10 @@ declare type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
22966
23287
 
22967
23288
  declare type RequestRedirect = 'error' | 'follow' | 'manual'
22968
23289
 
22969
- declare class Response_2 implements BodyMixin {
22970
- constructor (body?: BodyInit_2, init?: ResponseInit_2)
23290
+ declare class Response implements BodyMixin {
23291
+ constructor (body?: BodyInit, init?: ResponseInit)
22971
23292
 
22972
- readonly headers: Headers_2
23293
+ readonly headers: Headers
22973
23294
  readonly ok: boolean
22974
23295
  readonly status: number
22975
23296
  readonly statusText: string
@@ -22977,26 +23298,26 @@ declare class Response_2 implements BodyMixin {
22977
23298
  readonly url: string
22978
23299
  readonly redirected: boolean
22979
23300
 
22980
- readonly body: ReadableStream_2 | null
23301
+ readonly body: ReadableStream | null
22981
23302
  readonly bodyUsed: boolean
22982
23303
 
22983
23304
  readonly arrayBuffer: () => Promise<ArrayBuffer>
22984
23305
  readonly blob: () => Promise<Blob_2>
22985
- readonly formData: () => Promise<FormData_2>
23306
+ readonly formData: () => Promise<FormData>
22986
23307
  readonly json: () => Promise<unknown>
22987
23308
  readonly text: () => Promise<string>
22988
23309
 
22989
- readonly clone: () => Response_2
23310
+ readonly clone: () => Response
22990
23311
 
22991
- static error (): Response_2
22992
- static json(data: any, init?: ResponseInit_2): Response_2
22993
- static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response_2
23312
+ static error (): Response
23313
+ static json(data: any, init?: ResponseInit): Response
23314
+ static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response
22994
23315
  }
22995
23316
 
22996
- declare interface ResponseInit_2 {
23317
+ declare interface ResponseInit {
22997
23318
  readonly status?: number
22998
23319
  readonly statusText?: string
22999
- readonly headers?: HeadersInit_2
23320
+ readonly headers?: HeadersInit
23000
23321
  }
23001
23322
 
23002
23323
  declare type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308
@@ -23009,6 +23330,119 @@ declare type ResponseType =
23009
23330
  | 'opaque'
23010
23331
  | 'opaqueredirect'
23011
23332
 
23333
+ declare class RetryHandler implements Dispatcher.DispatchHandlers {
23334
+ constructor(
23335
+ options: Dispatcher.DispatchOptions & {
23336
+ retryOptions?: RetryHandler.RetryOptions;
23337
+ },
23338
+ retryHandlers: RetryHandler.RetryHandlers
23339
+ );
23340
+ }
23341
+
23342
+ declare namespace RetryHandler {
23343
+ type RetryState = { counter: number; currentTimeout: number };
23344
+
23345
+ type RetryContext = {
23346
+ state: RetryState;
23347
+ opts: Dispatcher.DispatchOptions & {
23348
+ retryOptions?: RetryHandler.RetryOptions;
23349
+ };
23350
+ }
23351
+
23352
+ type OnRetryCallback = (result?: Error | null) => void;
23353
+
23354
+ type RetryCallback = (
23355
+ err: Error,
23356
+ context: {
23357
+ state: RetryState;
23358
+ opts: Dispatcher.DispatchOptions & {
23359
+ retryOptions?: RetryHandler.RetryOptions;
23360
+ };
23361
+ },
23362
+ callback: OnRetryCallback
23363
+ ) => number | null;
23364
+
23365
+ interface RetryOptions {
23366
+ /**
23367
+ * Callback to be invoked on every retry iteration.
23368
+ * It receives the error, current state of the retry object and the options object
23369
+ * passed when instantiating the retry handler.
23370
+ *
23371
+ * @type {RetryCallback}
23372
+ * @memberof RetryOptions
23373
+ */
23374
+ retry?: RetryCallback;
23375
+ /**
23376
+ * Maximum number of retries to allow.
23377
+ *
23378
+ * @type {number}
23379
+ * @memberof RetryOptions
23380
+ * @default 5
23381
+ */
23382
+ maxRetries?: number;
23383
+ /**
23384
+ * Max number of milliseconds allow between retries
23385
+ *
23386
+ * @type {number}
23387
+ * @memberof RetryOptions
23388
+ * @default 30000
23389
+ */
23390
+ maxTimeout?: number;
23391
+ /**
23392
+ * Initial number of milliseconds to wait before retrying for the first time.
23393
+ *
23394
+ * @type {number}
23395
+ * @memberof RetryOptions
23396
+ * @default 500
23397
+ */
23398
+ minTimeout?: number;
23399
+ /**
23400
+ * Factior to multiply the timeout factor between retries.
23401
+ *
23402
+ * @type {number}
23403
+ * @memberof RetryOptions
23404
+ * @default 2
23405
+ */
23406
+ timeoutFactor?: number;
23407
+ /**
23408
+ * It enables to automatically infer timeout between retries based on the `Retry-After` header.
23409
+ *
23410
+ * @type {boolean}
23411
+ * @memberof RetryOptions
23412
+ * @default true
23413
+ */
23414
+ retryAfter?: boolean;
23415
+ /**
23416
+ * HTTP methods to retry.
23417
+ *
23418
+ * @type {Dispatcher.HttpMethod[]}
23419
+ * @memberof RetryOptions
23420
+ * @default ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
23421
+ */
23422
+ methods?: Dispatcher.HttpMethod[];
23423
+ /**
23424
+ * Error codes to be retried. e.g. `ECONNRESET`, `ENOTFOUND`, `ETIMEDOUT`, `ECONNREFUSED`, etc.
23425
+ *
23426
+ * @type {string[]}
23427
+ * @default ['ECONNRESET','ECONNREFUSED','ENOTFOUND','ENETDOWN','ENETUNREACH','EHOSTDOWN','EHOSTUNREACH','EPIPE']
23428
+ */
23429
+ errorCodes?: string[];
23430
+ /**
23431
+ * HTTP status codes to be retried.
23432
+ *
23433
+ * @type {number[]}
23434
+ * @memberof RetryOptions
23435
+ * @default [500, 502, 503, 504, 429],
23436
+ */
23437
+ statusCodes?: number[];
23438
+ }
23439
+
23440
+ interface RetryHandlers {
23441
+ dispatch: Dispatcher["dispatch"];
23442
+ handler: Dispatcher.DispatchHandlers;
23443
+ }
23444
+ }
23445
+
23012
23446
  declare type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
23013
23447
 
23014
23448
  /**
@@ -23029,7 +23463,7 @@ declare abstract class RuntimeController extends Controller {
23029
23463
  abstract emitReloadCompletetEvent(data: ReloadCompleteEvent): void;
23030
23464
  on(event: "reloadStart", listener: (_: ReloadStartEvent) => void): this;
23031
23465
  on(event: "reloadComplete", listener: (_: ReloadCompleteEvent) => void): this;
23032
- on(event: "error", listener: (_: ErrorEvent_2) => void): this;
23466
+ on(event: "error", listener: (_: ErrorEvent) => void): this;
23033
23467
  once: typeof RuntimeController.on;
23034
23468
  }
23035
23469
 
@@ -23051,9 +23485,9 @@ declare interface ServiceDesignator {
23051
23485
  env?: string;
23052
23486
  }
23053
23487
 
23054
- declare type ServiceFetch = (request: Request_3) => Promise<Response_3>;
23488
+ declare type ServiceFetch = (request: Request_2) => Promise<Response_2>;
23055
23489
 
23056
- declare function setCookie (headers: Headers_2, cookie: Cookie): void
23490
+ declare function setCookie (headers: Headers, cookie: Cookie): void
23057
23491
 
23058
23492
  declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher>(dispatcher: DispatcherImplementation): void;
23059
23493
 
@@ -23061,6 +23495,10 @@ declare function setGlobalOrigin(origin: string | URL | undefined): void;
23061
23495
 
23062
23496
  declare type SimpleRoute = string;
23063
23497
 
23498
+ export declare type SourcelessWorkerOptions = Omit<WorkerOptions, "script" | "scriptPath" | "modules" | "modulesRoot"> & {
23499
+ modulesRules?: ModuleRule_2[];
23500
+ };
23501
+
23064
23502
  /**
23065
23503
  * Information about Wrangler's bundling process that needs passed through
23066
23504
  * for DevTools sourcemap transformation
@@ -23090,9 +23528,9 @@ declare interface StartDevWorkerOptions {
23090
23528
  * This is the `main` property of a wrangler.toml.
23091
23529
  * You can specify a file path or provide the contents directly.
23092
23530
  */
23093
- script: File_3<string>;
23531
+ script: File_2<string>;
23094
23532
  /** The configuration of the worker. */
23095
- config?: File_3<string | RawConfig> & {
23533
+ config?: File_2<string | RawConfig> & {
23096
23534
  env?: string;
23097
23535
  };
23098
23536
  /** The compatibility date for the workerd runtime. */
@@ -23156,6 +23594,8 @@ declare interface StartDevWorkerOptions {
23156
23594
  hostname?: string;
23157
23595
  port?: number;
23158
23596
  secure?: boolean;
23597
+ httpsKeyPath?: string;
23598
+ httpsCertPath?: string;
23159
23599
  };
23160
23600
  /** Controls what request.url looks like inside the worker. */
23161
23601
  urlOverrides?: {
@@ -23218,6 +23658,7 @@ declare namespace Undici {
23218
23658
  var Pool: Pool;
23219
23659
  var RedirectHandler: RedirectHandler
23220
23660
  var DecoratorHandler: DecoratorHandler
23661
+ var RetryHandler: RetryHandler
23221
23662
  var createRedirectInterceptor: createRedirectInterceptor
23222
23663
  var BalancedPool: BalancedPool;
23223
23664
  var Client: Client;
@@ -23235,11 +23676,19 @@ declare namespace Undici {
23235
23676
  var MockPool: MockPool;
23236
23677
  var MockAgent: MockAgent;
23237
23678
  var mockErrors: MockErrors;
23238
- var fetch: fetch_2;
23679
+ var fetch: fetch;
23680
+ var Headers: Headers;
23681
+ var Response: Response;
23682
+ var Request: Request;
23683
+ var FormData: FormData;
23684
+ var File: File;
23685
+ var FileReader: FileReader;
23686
+ var caches: caches;
23239
23687
  }
23240
23688
 
23241
23689
  declare namespace undici {
23242
23690
  export {
23691
+ Undici as default,
23243
23692
  Interceptable,
23244
23693
  Dispatcher,
23245
23694
  BalancedPool,
@@ -23264,53 +23713,59 @@ declare namespace undici {
23264
23713
  ProxyAgent,
23265
23714
  RedirectHandler,
23266
23715
  DecoratorHandler,
23267
- Undici as default,
23716
+ RetryHandler,
23268
23717
  deleteCookie,
23269
23718
  getCookies,
23270
23719
  getSetCookies,
23271
23720
  setCookie,
23272
23721
  Cookie,
23273
- fetch_2 as fetch,
23274
- RequestInfo_2 as RequestInfo,
23275
- BodyInit_2 as BodyInit,
23722
+ fetch,
23723
+ RequestInfo,
23724
+ BodyInit,
23276
23725
  BodyMixin,
23277
23726
  SpecIterator,
23278
23727
  SpecIterableIterator,
23279
23728
  SpecIterable,
23280
- HeadersInit_2 as HeadersInit,
23281
- Headers_2 as Headers,
23729
+ HeadersInit,
23730
+ Headers,
23282
23731
  RequestCache,
23283
23732
  RequestCredentials,
23284
23733
  RequestDestination,
23285
- RequestInit_2 as RequestInit,
23734
+ RequestInit,
23286
23735
  ReferrerPolicy,
23287
23736
  RequestMode,
23288
23737
  RequestRedirect,
23289
23738
  RequestDuplex,
23290
- Request_2 as Request,
23291
- ResponseInit_2 as ResponseInit,
23739
+ Request,
23740
+ ResponseInit,
23292
23741
  ResponseType,
23293
23742
  ResponseRedirectStatus,
23294
- Response_2 as Response,
23743
+ Response,
23295
23744
  BlobPropertyBag,
23296
23745
  FilePropertyBag,
23297
- File_2 as File,
23746
+ File,
23298
23747
  FileReader,
23299
23748
  ProgressEventInit,
23300
23749
  ProgressEvent,
23301
23750
  FormDataEntryValue,
23302
- FormData_2 as FormData,
23751
+ FormData,
23303
23752
  DiagnosticsChannel,
23304
23753
  BinaryType,
23305
- WebSocketEventMap_2 as WebSocketEventMap,
23306
- WebSocket_2 as WebSocket,
23307
- CloseEventInit_2 as CloseEventInit,
23308
- CloseEvent_2 as CloseEvent,
23309
- MessageEventInit_2 as MessageEventInit,
23310
- MessageEvent_2 as MessageEvent,
23754
+ WebSocketEventMap,
23755
+ WebSocket,
23756
+ CloseEventInit,
23757
+ CloseEvent,
23758
+ MessageEventInit,
23759
+ MessageEvent,
23760
+ WebSocketInit,
23311
23761
  parseMIMEType,
23312
23762
  serializeAMimeType,
23313
- MIMEType
23763
+ MIMEType,
23764
+ CacheStorage,
23765
+ Cache,
23766
+ CacheQueryOptions,
23767
+ MultiCacheQueryOptions,
23768
+ caches
23314
23769
  }
23315
23770
  }
23316
23771
 
@@ -23335,13 +23790,29 @@ export declare class unstable_DevEnv extends EventEmitter_2 {
23335
23790
  proxy?: ProxyController | undefined;
23336
23791
  });
23337
23792
  teardown(): Promise<void>;
23338
- emitErrorEvent(ev: ErrorEvent_2): void;
23793
+ emitErrorEvent(ev: ErrorEvent): void;
23339
23794
  }
23340
23795
 
23796
+ export declare function unstable_getMiniflareWorkerOptions(configPath: string): {
23797
+ workerOptions: SourcelessWorkerOptions;
23798
+ define: Record<string, string>;
23799
+ main?: string;
23800
+ };
23801
+
23341
23802
  export declare const unstable_pages: {
23342
23803
  deploy: typeof deploy;
23343
23804
  };
23344
23805
 
23806
+ /**
23807
+ * Split an SQLQuery into an array of statements
23808
+ */
23809
+ export declare function unstable_splitSqlQuery(sql: string): string[];
23810
+
23811
+ export declare function unstable_startWorkerRegistryServer(port: number): Promise<{
23812
+ server: Server<IncomingMessage, ServerResponse>;
23813
+ terminator: HttpTerminator;
23814
+ }>;
23815
+
23345
23816
  export declare interface UnstableDevOptions {
23346
23817
  config?: string;
23347
23818
  env?: string;
@@ -23350,6 +23821,8 @@ export declare interface UnstableDevOptions {
23350
23821
  bundle?: boolean;
23351
23822
  inspectorPort?: number;
23352
23823
  localProtocol?: "http" | "https";
23824
+ httpsKeyPath?: string;
23825
+ httpsCertPath?: string;
23353
23826
  assets?: string;
23354
23827
  site?: string;
23355
23828
  siteInclude?: string[];
@@ -23357,6 +23830,7 @@ export declare interface UnstableDevOptions {
23357
23830
  nodeCompat?: boolean;
23358
23831
  compatibilityDate?: string;
23359
23832
  compatibilityFlags?: string[];
23833
+ dispatchNamespace?: string;
23360
23834
  persist?: boolean;
23361
23835
  persistTo?: string;
23362
23836
  vars?: Record<string, string | Json>;
@@ -23375,6 +23849,7 @@ export declare interface UnstableDevOptions {
23375
23849
  binding: string;
23376
23850
  service: string;
23377
23851
  environment?: string | undefined;
23852
+ entrypoint?: string | undefined;
23378
23853
  }[];
23379
23854
  r2?: {
23380
23855
  binding: string;
@@ -23384,6 +23859,14 @@ export declare interface UnstableDevOptions {
23384
23859
  ai?: {
23385
23860
  binding: string;
23386
23861
  };
23862
+ version_metadata?: {
23863
+ binding: string;
23864
+ };
23865
+ dispatchNamespaces?: {
23866
+ binding: string;
23867
+ namespace: string;
23868
+ outbound?: DispatchNamespaceOutbound;
23869
+ }[];
23387
23870
  moduleRoot?: string;
23388
23871
  rules?: Rule[];
23389
23872
  logLevel?: "none" | "info" | "error" | "log" | "warn" | "debug";
@@ -23412,7 +23895,7 @@ export declare interface UnstableDevWorker {
23412
23895
  address: string;
23413
23896
  proxyData: ProxyData;
23414
23897
  stop: () => Promise<void>;
23415
- fetch: (input?: RequestInfo_2, init?: RequestInit_2) => Promise<Response_2>;
23898
+ fetch: (input?: RequestInfo, init?: RequestInit) => Promise<Response>;
23416
23899
  waitUntilExit: () => Promise<void>;
23417
23900
  }
23418
23901
 
@@ -23431,67 +23914,78 @@ declare interface UserLimits {
23431
23914
  cpu_ms: number;
23432
23915
  }
23433
23916
 
23434
- declare interface WebSocket_2 extends EventTarget_2 {
23917
+ declare interface WebSocket extends EventTarget_2 {
23435
23918
  binaryType: BinaryType
23436
23919
 
23437
23920
  readonly bufferedAmount: number
23438
23921
  readonly extensions: string
23439
23922
 
23440
- onclose: ((this: WebSocket_2, ev: WebSocketEventMap_2['close']) => any) | null
23441
- onerror: ((this: WebSocket_2, ev: WebSocketEventMap_2['error']) => any) | null
23442
- onmessage: ((this: WebSocket_2, ev: WebSocketEventMap_2['message']) => any) | null
23443
- onopen: ((this: WebSocket_2, ev: WebSocketEventMap_2['open']) => any) | null
23923
+ onclose: ((this: WebSocket, ev: WebSocketEventMap['close']) => any) | null
23924
+ onerror: ((this: WebSocket, ev: WebSocketEventMap['error']) => any) | null
23925
+ onmessage: ((this: WebSocket, ev: WebSocketEventMap['message']) => any) | null
23926
+ onopen: ((this: WebSocket, ev: WebSocketEventMap['open']) => any) | null
23444
23927
 
23445
23928
  readonly protocol: string
23446
23929
  readonly readyState: number
23447
23930
  readonly url: string
23448
23931
 
23449
23932
  close(code?: number, reason?: string): void
23450
- send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void
23933
+ send(data: string | ArrayBufferLike | Blob_2 | ArrayBufferView): void
23451
23934
 
23452
23935
  readonly CLOSED: number
23453
23936
  readonly CLOSING: number
23454
23937
  readonly CONNECTING: number
23455
23938
  readonly OPEN: number
23456
23939
 
23457
- addEventListener<K extends keyof WebSocketEventMap_2>(
23940
+ addEventListener<K extends keyof WebSocketEventMap>(
23458
23941
  type: K,
23459
- listener: (this: WebSocket_2, ev: WebSocketEventMap_2[K]) => any,
23942
+ listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any,
23460
23943
  options?: boolean | AddEventListenerOptions
23461
23944
  ): void
23462
23945
  addEventListener(
23463
23946
  type: string,
23464
- listener: EventListenerOrEventListenerObject_2,
23947
+ listener: EventListenerOrEventListenerObject,
23465
23948
  options?: boolean | AddEventListenerOptions
23466
23949
  ): void
23467
- removeEventListener<K extends keyof WebSocketEventMap_2>(
23950
+ removeEventListener<K extends keyof WebSocketEventMap>(
23468
23951
  type: K,
23469
- listener: (this: WebSocket_2, ev: WebSocketEventMap_2[K]) => any,
23952
+ listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any,
23470
23953
  options?: boolean | EventListenerOptions
23471
23954
  ): void
23472
23955
  removeEventListener(
23473
23956
  type: string,
23474
- listener: EventListenerOrEventListenerObject_2,
23957
+ listener: EventListenerOrEventListenerObject,
23475
23958
  options?: boolean | EventListenerOptions
23476
23959
  ): void
23477
23960
  }
23478
23961
 
23479
- declare const WebSocket_2: {
23480
- prototype: WebSocket_2
23481
- new (url: string | URL, protocols?: string | string[]): WebSocket_2
23962
+ declare const WebSocket: {
23963
+ prototype: WebSocket
23964
+ new (url: string | URL, protocols?: string | string[] | WebSocketInit): WebSocket
23482
23965
  readonly CLOSED: number
23483
23966
  readonly CLOSING: number
23484
23967
  readonly CONNECTING: number
23485
23968
  readonly OPEN: number
23486
23969
  };
23487
23970
 
23488
- declare interface WebSocketEventMap_2 {
23489
- close: CloseEvent_2
23971
+ declare interface WebSocketEventMap {
23972
+ close: CloseEvent
23490
23973
  error: Event_2
23491
- message: MessageEvent_2
23974
+ message: MessageEvent
23492
23975
  open: Event_2
23493
23976
  }
23494
23977
 
23978
+ declare interface WebSocketInit {
23979
+ protocols?: string | string[],
23980
+ dispatcher?: Dispatcher,
23981
+ headers?: HeadersInit
23982
+ }
23983
+
23984
+ declare type WorkerEntrypointsDefinition = Record<"default" | string, {
23985
+ host: string;
23986
+ port: number;
23987
+ } | undefined>;
23988
+
23495
23989
  declare type ZoneIdRoute = {
23496
23990
  pattern: string;
23497
23991
  zone_id: string;