wrangler 0.0.0-e6733a3 → 0.0.0-e7a0cd5b

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.
Files changed (302) hide show
  1. package/Cloudflare_CA.pem +18 -0
  2. package/README.md +47 -14
  3. package/bin/wrangler.js +160 -28
  4. package/kv-asset-handler.js +1 -0
  5. package/miniflare-dist/index.mjs +6316 -0
  6. package/package.json +190 -124
  7. package/src/__tests__/access.test.ts +25 -0
  8. package/src/__tests__/api-dev.test.ts +209 -0
  9. package/src/__tests__/api-devregistry.test.js +57 -0
  10. package/src/__tests__/api.test.ts +80 -0
  11. package/src/__tests__/config-cache-without-cache-dir.test.ts +38 -0
  12. package/src/__tests__/config-cache.test.ts +42 -0
  13. package/src/__tests__/configuration.test.ts +4028 -0
  14. package/src/__tests__/d1.test.ts +72 -0
  15. package/src/__tests__/delete.test.ts +230 -0
  16. package/src/__tests__/deployments.test.ts +95 -0
  17. package/src/__tests__/dev.test.tsx +1505 -62
  18. package/src/__tests__/dialogs.test.tsx +40 -0
  19. package/src/__tests__/generate.test.ts +235 -0
  20. package/src/__tests__/get-host-from-url.test.ts +16 -0
  21. package/src/__tests__/guess-worker-format.test.ts +85 -0
  22. package/src/__tests__/{clipboardy-mock.js → helpers/clipboardy-mock.js} +0 -0
  23. package/src/__tests__/helpers/cmd-shim.d.ts +11 -0
  24. package/src/__tests__/helpers/mock-account-id.ts +48 -0
  25. package/src/__tests__/helpers/mock-bin.ts +36 -0
  26. package/src/__tests__/helpers/mock-cfetch.ts +333 -0
  27. package/src/__tests__/helpers/mock-console.ts +106 -0
  28. package/src/__tests__/helpers/mock-dialogs.ts +153 -0
  29. package/src/__tests__/helpers/mock-get-zone-from-host.ts +8 -0
  30. package/src/__tests__/helpers/mock-http-server.ts +46 -0
  31. package/src/__tests__/helpers/mock-istty.ts +74 -0
  32. package/src/__tests__/helpers/mock-known-routes.ts +7 -0
  33. package/src/__tests__/helpers/mock-kv.ts +33 -0
  34. package/src/__tests__/helpers/mock-oauth-flow.ts +252 -0
  35. package/src/__tests__/helpers/mock-process.ts +39 -0
  36. package/src/__tests__/helpers/mock-stdin.ts +108 -0
  37. package/src/__tests__/helpers/mock-web-socket.ts +29 -0
  38. package/src/__tests__/helpers/msw/handlers/access.ts +13 -0
  39. package/src/__tests__/helpers/msw/handlers/deployments.ts +59 -0
  40. package/src/__tests__/helpers/msw/handlers/namespaces.ts +104 -0
  41. package/src/__tests__/helpers/msw/handlers/oauth.ts +36 -0
  42. package/src/__tests__/helpers/msw/handlers/r2.ts +80 -0
  43. package/src/__tests__/helpers/msw/handlers/script.ts +75 -0
  44. package/src/__tests__/helpers/msw/handlers/user.ts +63 -0
  45. package/src/__tests__/helpers/msw/handlers/zones.ts +22 -0
  46. package/src/__tests__/helpers/msw/index.ts +21 -0
  47. package/src/__tests__/helpers/run-in-tmp.ts +38 -0
  48. package/src/__tests__/helpers/run-wrangler.ts +16 -0
  49. package/src/__tests__/helpers/worker-scripts/child-wrangler.toml +1 -0
  50. package/src/__tests__/helpers/worker-scripts/hello-world-worker.js +5 -0
  51. package/src/__tests__/helpers/worker-scripts/hello-world-wrangler.toml +1 -0
  52. package/src/__tests__/helpers/worker-scripts/parent-worker.js +8 -0
  53. package/src/__tests__/helpers/worker-scripts/parent-wrangler.toml +5 -0
  54. package/src/__tests__/helpers/write-worker-source.ts +31 -0
  55. package/src/__tests__/helpers/write-wrangler-toml.ts +17 -0
  56. package/src/__tests__/https-options.test.ts +163 -0
  57. package/src/__tests__/index.test.ts +259 -284
  58. package/src/__tests__/init.test.ts +2900 -0
  59. package/src/__tests__/jest.setup.ts +190 -10
  60. package/src/__tests__/kv.test.ts +1668 -1091
  61. package/src/__tests__/logger.test.ts +141 -0
  62. package/src/__tests__/metrics.test.ts +450 -0
  63. package/src/__tests__/middleware.scheduled.test.ts +135 -0
  64. package/src/__tests__/middleware.test.ts +726 -0
  65. package/src/__tests__/package-manager.test.ts +353 -0
  66. package/src/__tests__/pages.test.ts +2223 -0
  67. package/src/__tests__/parse.test.ts +330 -0
  68. package/src/__tests__/paths.test.ts +39 -0
  69. package/src/__tests__/publish.test.ts +7660 -0
  70. package/src/__tests__/pubsub.test.ts +370 -0
  71. package/src/__tests__/queues.test.ts +371 -0
  72. package/src/__tests__/r2.test.ts +376 -0
  73. package/src/__tests__/route.test.ts +45 -0
  74. package/src/__tests__/secret.test.ts +644 -0
  75. package/src/__tests__/tail.test.ts +800 -0
  76. package/src/__tests__/test-old-node-version.js +31 -0
  77. package/src/__tests__/type-generation.test.ts +217 -0
  78. package/src/__tests__/user.test.ts +155 -0
  79. package/src/__tests__/utils-collectKeyValues.test.ts +47 -0
  80. package/src/__tests__/validate-dev-props.test.ts +56 -0
  81. package/src/__tests__/version.test.ts +35 -0
  82. package/src/__tests__/whoami.test.tsx +278 -0
  83. package/src/__tests__/worker-namespace.test.ts +326 -0
  84. package/src/abort.d.ts +3 -0
  85. package/src/api/dev.ts +208 -0
  86. package/src/api/index.ts +2 -0
  87. package/src/bundle-reporter.tsx +68 -0
  88. package/src/bundle.ts +785 -0
  89. package/src/cfetch/index.ts +128 -70
  90. package/src/cfetch/internal.ts +240 -46
  91. package/src/cli.ts +25 -6
  92. package/src/config/README.md +107 -0
  93. package/src/config/config.ts +275 -0
  94. package/src/config/diagnostics.ts +80 -0
  95. package/src/config/environment.ts +563 -0
  96. package/src/config/index.ts +342 -0
  97. package/src/config/validation-helpers.ts +597 -0
  98. package/src/config/validation.ts +2113 -0
  99. package/src/config-cache.ts +85 -0
  100. package/src/create-worker-preview.ts +282 -0
  101. package/src/create-worker-upload-form.ts +321 -0
  102. package/src/d1/backups.tsx +218 -0
  103. package/src/d1/create.tsx +54 -0
  104. package/src/d1/delete.tsx +56 -0
  105. package/src/d1/execute.tsx +299 -0
  106. package/src/d1/formatTimeAgo.ts +14 -0
  107. package/src/d1/index.ts +76 -0
  108. package/src/d1/list.tsx +48 -0
  109. package/src/d1/options.ts +12 -0
  110. package/src/d1/types.tsx +14 -0
  111. package/src/d1/utils.ts +39 -0
  112. package/src/delete.ts +108 -0
  113. package/src/deployments.ts +74 -0
  114. package/src/deprecated/index.ts +438 -0
  115. package/src/dev/dev-vars.ts +39 -0
  116. package/src/dev/dev.tsx +587 -0
  117. package/src/dev/get-local-persistence-path.tsx +31 -0
  118. package/src/dev/local.tsx +717 -0
  119. package/src/dev/remote.tsx +603 -0
  120. package/src/dev/start-server.ts +513 -0
  121. package/src/dev/use-esbuild.ts +204 -0
  122. package/src/dev/validate-dev-props.ts +31 -0
  123. package/src/dev-registry.tsx +201 -0
  124. package/src/dev.tsx +848 -750
  125. package/src/dialogs.tsx +146 -60
  126. package/src/dispatch-namespace.ts +207 -0
  127. package/src/durable.ts +102 -0
  128. package/src/entry.ts +329 -0
  129. package/src/environment-variables.ts +50 -0
  130. package/src/errors.ts +11 -0
  131. package/src/git-client.ts +124 -0
  132. package/src/global-wrangler-config-path.ts +26 -0
  133. package/src/https-options.ts +127 -0
  134. package/src/index.tsx +669 -1959
  135. package/src/init.ts +970 -0
  136. package/src/inspect.ts +720 -477
  137. package/src/intl-polyfill.d.ts +139 -0
  138. package/src/is-ci.ts +14 -0
  139. package/src/is-interactive.ts +16 -0
  140. package/src/kv/helpers.ts +430 -0
  141. package/src/kv/index.ts +596 -0
  142. package/src/logger.ts +92 -0
  143. package/src/metrics/index.ts +5 -0
  144. package/src/metrics/metrics-config.ts +239 -0
  145. package/src/metrics/metrics-dispatcher.ts +96 -0
  146. package/src/metrics/metrics-usage-headers.ts +24 -0
  147. package/src/metrics/send-event.ts +94 -0
  148. package/src/miniflare-cli/README.md +30 -0
  149. package/src/miniflare-cli/assets.ts +215 -0
  150. package/src/miniflare-cli/index.ts +213 -0
  151. package/src/miniflare-cli/request-context.ts +40 -0
  152. package/src/module-collection.ts +256 -53
  153. package/src/open-in-browser.ts +17 -0
  154. package/src/package-manager.ts +219 -0
  155. package/src/pages/build.tsx +238 -0
  156. package/src/pages/constants.ts +18 -0
  157. package/src/pages/deployments.tsx +106 -0
  158. package/src/pages/dev.tsx +693 -0
  159. package/src/pages/errors.ts +66 -0
  160. package/src/pages/functions/buildPlugin.ts +110 -0
  161. package/src/pages/functions/buildWorker.ts +156 -0
  162. package/src/pages/functions/filepath-routing.test.ts +234 -0
  163. package/src/pages/functions/filepath-routing.ts +189 -0
  164. package/src/pages/functions/identifiers.ts +78 -0
  165. package/src/pages/functions/routes-consolidation.test.ts +250 -0
  166. package/src/pages/functions/routes-consolidation.ts +73 -0
  167. package/src/pages/functions/routes-transformation.test.ts +282 -0
  168. package/src/pages/functions/routes-transformation.ts +115 -0
  169. package/src/pages/functions/routes-validation.test.ts +403 -0
  170. package/src/pages/functions/routes-validation.ts +202 -0
  171. package/src/pages/functions/routes.ts +151 -0
  172. package/src/pages/functions.tsx +82 -0
  173. package/src/pages/hash.tsx +13 -0
  174. package/src/pages/index.tsx +94 -0
  175. package/src/pages/projects.tsx +169 -0
  176. package/src/pages/publish.tsx +436 -0
  177. package/src/pages/types.ts +49 -0
  178. package/src/pages/upload.tsx +425 -0
  179. package/src/pages/utils.ts +12 -0
  180. package/src/parse.ts +286 -0
  181. package/src/paths.ts +71 -0
  182. package/src/proxy.ts +647 -252
  183. package/src/publish/index.ts +270 -0
  184. package/src/publish/publish.ts +1035 -0
  185. package/src/pubsub/index.ts +286 -0
  186. package/src/pubsub/pubsub-commands.tsx +624 -0
  187. package/src/queues/cli/commands/consumer/add.ts +71 -0
  188. package/src/queues/cli/commands/consumer/index.ts +22 -0
  189. package/src/queues/cli/commands/consumer/remove.ts +38 -0
  190. package/src/queues/cli/commands/create.ts +25 -0
  191. package/src/queues/cli/commands/delete.ts +26 -0
  192. package/src/queues/cli/commands/index.ts +33 -0
  193. package/src/queues/cli/commands/list.ts +25 -0
  194. package/src/queues/client.ts +135 -0
  195. package/src/r2/helpers.ts +131 -0
  196. package/src/r2/index.ts +277 -0
  197. package/src/routes.ts +140 -0
  198. package/src/secret/index.ts +379 -0
  199. package/src/selfsigned.d.ts +29 -0
  200. package/src/sites.tsx +357 -99
  201. package/src/tail/createTail.ts +315 -0
  202. package/src/tail/filters.ts +277 -0
  203. package/src/tail/index.ts +214 -0
  204. package/src/tail/printing.ts +107 -0
  205. package/src/type-generation.ts +159 -0
  206. package/src/update-check.ts +19 -0
  207. package/src/user/access.ts +69 -0
  208. package/src/user/choose-account.tsx +69 -0
  209. package/src/user/env-vars.ts +46 -0
  210. package/src/user/generate-auth-url.ts +33 -0
  211. package/src/user/generate-random-state.ts +16 -0
  212. package/src/user/index.ts +3 -0
  213. package/src/user/user.tsx +1192 -0
  214. package/src/utils/collectKeyValues.ts +14 -0
  215. package/src/whoami.tsx +169 -0
  216. package/src/worker.ts +242 -0
  217. package/src/yargs-types.ts +20 -0
  218. package/src/zones.ts +191 -0
  219. package/templates/__tests__/pages-dev-util.test.ts +128 -0
  220. package/templates/checked-fetch.js +17 -0
  221. package/templates/d1-beta-facade.js +174 -0
  222. package/templates/experimental-local-cache-stubs.js +27 -0
  223. package/templates/first-party-worker-module-facade.ts +18 -0
  224. package/templates/format-dev-errors.ts +32 -0
  225. package/templates/gitignore +171 -0
  226. package/templates/init-tests/test-jest-new-worker.js +25 -0
  227. package/templates/init-tests/test-vitest-new-worker.js +26 -0
  228. package/templates/middleware/common.ts +62 -0
  229. package/templates/middleware/loader-modules.ts +84 -0
  230. package/templates/middleware/loader-sw.ts +213 -0
  231. package/templates/middleware/middleware-pretty-error.ts +40 -0
  232. package/templates/middleware/middleware-scheduled.ts +15 -0
  233. package/templates/new-worker-scheduled.js +17 -0
  234. package/templates/new-worker-scheduled.ts +32 -0
  235. package/templates/new-worker.js +15 -0
  236. package/templates/new-worker.ts +30 -0
  237. package/templates/no-op-worker.js +10 -0
  238. package/templates/pages-dev-pipeline.ts +28 -0
  239. package/templates/pages-dev-util.ts +52 -0
  240. package/templates/pages-shim.ts +9 -0
  241. package/templates/pages-template-plugin.ts +171 -0
  242. package/templates/pages-template-worker.ts +189 -0
  243. package/templates/serve-static-assets.ts +63 -0
  244. package/templates/service-bindings-module-facade.js +54 -0
  245. package/templates/service-bindings-sw-facade.js +42 -0
  246. package/templates/tsconfig.json +106 -0
  247. package/wrangler-dist/cli.d.ts +892 -0
  248. package/wrangler-dist/cli.js +142402 -103276
  249. package/pages/functions/buildWorker.ts +0 -62
  250. package/pages/functions/filepath-routing.test.ts +0 -39
  251. package/pages/functions/filepath-routing.ts +0 -221
  252. package/pages/functions/identifiers.ts +0 -78
  253. package/pages/functions/routes.ts +0 -158
  254. package/pages/functions/template-worker.ts +0 -144
  255. package/src/__tests__/mock-cfetch.ts +0 -171
  256. package/src/__tests__/mock-dialogs.ts +0 -65
  257. package/src/__tests__/run-in-tmp.ts +0 -19
  258. package/src/__tests__/run-wrangler.ts +0 -32
  259. package/src/api/form_data.ts +0 -131
  260. package/src/api/preview.ts +0 -128
  261. package/src/api/worker.ts +0 -155
  262. package/src/config.ts +0 -487
  263. package/src/kv.tsx +0 -267
  264. package/src/pages.tsx +0 -1031
  265. package/src/publish.ts +0 -358
  266. package/src/tail.tsx +0 -73
  267. package/src/user.tsx +0 -1025
  268. package/static-asset-facade.js +0 -47
  269. package/vendor/@cloudflare/kv-asset-handler/CHANGELOG.md +0 -332
  270. package/vendor/@cloudflare/kv-asset-handler/LICENSE_APACHE +0 -176
  271. package/vendor/@cloudflare/kv-asset-handler/LICENSE_MIT +0 -25
  272. package/vendor/@cloudflare/kv-asset-handler/README.md +0 -245
  273. package/vendor/@cloudflare/kv-asset-handler/dist/index.d.ts +0 -32
  274. package/vendor/@cloudflare/kv-asset-handler/dist/index.js +0 -354
  275. package/vendor/@cloudflare/kv-asset-handler/dist/mocks.d.ts +0 -13
  276. package/vendor/@cloudflare/kv-asset-handler/dist/mocks.js +0 -148
  277. package/vendor/@cloudflare/kv-asset-handler/dist/test/getAssetFromKV.d.ts +0 -1
  278. package/vendor/@cloudflare/kv-asset-handler/dist/test/getAssetFromKV.js +0 -436
  279. package/vendor/@cloudflare/kv-asset-handler/dist/test/mapRequestToAsset.d.ts +0 -1
  280. package/vendor/@cloudflare/kv-asset-handler/dist/test/mapRequestToAsset.js +0 -40
  281. package/vendor/@cloudflare/kv-asset-handler/dist/test/serveSinglePageApp.d.ts +0 -1
  282. package/vendor/@cloudflare/kv-asset-handler/dist/test/serveSinglePageApp.js +0 -42
  283. package/vendor/@cloudflare/kv-asset-handler/dist/types.d.ts +0 -26
  284. package/vendor/@cloudflare/kv-asset-handler/dist/types.js +0 -31
  285. package/vendor/@cloudflare/kv-asset-handler/package.json +0 -52
  286. package/vendor/@cloudflare/kv-asset-handler/src/index.ts +0 -296
  287. package/vendor/@cloudflare/kv-asset-handler/src/mocks.ts +0 -136
  288. package/vendor/@cloudflare/kv-asset-handler/src/test/getAssetFromKV.ts +0 -464
  289. package/vendor/@cloudflare/kv-asset-handler/src/test/mapRequestToAsset.ts +0 -33
  290. package/vendor/@cloudflare/kv-asset-handler/src/test/serveSinglePageApp.ts +0 -42
  291. package/vendor/@cloudflare/kv-asset-handler/src/types.ts +0 -39
  292. package/vendor/wrangler-mime/CHANGELOG.md +0 -289
  293. package/vendor/wrangler-mime/LICENSE +0 -21
  294. package/vendor/wrangler-mime/Mime.js +0 -97
  295. package/vendor/wrangler-mime/README.md +0 -187
  296. package/vendor/wrangler-mime/cli.js +0 -46
  297. package/vendor/wrangler-mime/index.js +0 -4
  298. package/vendor/wrangler-mime/lite.js +0 -4
  299. package/vendor/wrangler-mime/package.json +0 -52
  300. package/vendor/wrangler-mime/types/other.js +0 -1
  301. package/vendor/wrangler-mime/types/standard.js +0 -1
  302. package/wrangler-dist/cli.js.map +0 -7
@@ -0,0 +1,892 @@
1
+ /// <reference types="node" />
2
+
3
+ import { Blob as Blob_2 } from 'buffer';
4
+ import Dispatcher = require('./dispatcher');
5
+ import { ReadableStream } from 'stream/web';
6
+ import { URL as URL_2 } from 'url';
7
+ import { URLSearchParams as URLSearchParams_2 } from 'url';
8
+
9
+ declare interface BlobPropertyBag {
10
+ type?: string
11
+ endings?: 'native' | 'transparent'
12
+ }
13
+
14
+ declare type BodyInit =
15
+ | ArrayBuffer
16
+ | AsyncIterable<Uint8Array>
17
+ | Blob_2
18
+ | FormData
19
+ | Iterable<Uint8Array>
20
+ | NodeJS.ArrayBufferView
21
+ | URLSearchParams_2
22
+ | null
23
+ | string
24
+
25
+ declare interface BodyMixin {
26
+ readonly body: ReadableStream | null
27
+ readonly bodyUsed: boolean
28
+
29
+ readonly arrayBuffer: () => Promise<ArrayBuffer>
30
+ readonly blob: () => Promise<Blob_2>
31
+ readonly formData: () => Promise<FormData>
32
+ readonly json: () => Promise<unknown>
33
+ readonly text: () => Promise<string>
34
+ }
35
+
36
+ /**
37
+ * The possible types for a `Rule`.
38
+ */
39
+ declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data";
40
+
41
+ declare type CustomDomainRoute = {
42
+ pattern: string;
43
+ custom_domain: boolean;
44
+ };
45
+
46
+ /**
47
+ * Deprecated upload configuration.
48
+ */
49
+ declare interface DeprecatedUpload {
50
+ /**
51
+ * The format of the Worker script.
52
+ *
53
+ * @deprecated We infer the format automatically now.
54
+ */
55
+ format?: "modules" | "service-worker";
56
+ /**
57
+ * The directory you wish to upload your worker from,
58
+ * relative to the wrangler.toml file.
59
+ *
60
+ * Defaults to the directory containing the wrangler.toml file.
61
+ *
62
+ * @deprecated
63
+ */
64
+ dir?: string;
65
+ /**
66
+ * The path to the Worker script, relative to `upload.dir`.
67
+ *
68
+ * @deprecated This will be replaced by a command line argument.
69
+ */
70
+ main?: string;
71
+ /**
72
+ * @deprecated This is now defined at the top level `rules` field.
73
+ */
74
+ rules?: Environment["rules"];
75
+ }
76
+
77
+ declare interface DevApiOptions {
78
+ testMode?: boolean;
79
+ disableExperimentalWarning?: boolean;
80
+ }
81
+
82
+ declare interface DevOptions {
83
+ config?: string;
84
+ env?: string;
85
+ ip?: string;
86
+ port?: number;
87
+ bundle?: boolean;
88
+ inspectorPort?: number;
89
+ localProtocol?: "http" | "https";
90
+ assets?: string;
91
+ site?: string;
92
+ siteInclude?: string[];
93
+ siteExclude?: string[];
94
+ nodeCompat?: boolean;
95
+ compatibilityDate?: string;
96
+ compatibilityFlags?: string[];
97
+ persist?: boolean;
98
+ persistTo?: string;
99
+ liveReload?: boolean;
100
+ watch?: boolean;
101
+ vars?: {
102
+ [key: string]: unknown;
103
+ };
104
+ kv?: {
105
+ binding: string;
106
+ id: string;
107
+ preview_id?: string;
108
+ }[];
109
+ durableObjects?: {
110
+ name: string;
111
+ class_name: string;
112
+ script_name?: string | undefined;
113
+ environment?: string | undefined;
114
+ }[];
115
+ r2?: {
116
+ binding: string;
117
+ bucket_name: string;
118
+ preview_bucket_name?: string;
119
+ }[];
120
+ d1Databases?: Environment["d1_databases"];
121
+ showInteractiveDevSession?: boolean;
122
+ logLevel?: "none" | "info" | "error" | "log" | "warn" | "debug";
123
+ logPrefix?: string;
124
+ inspect?: boolean;
125
+ local?: boolean;
126
+ forceLocal?: boolean;
127
+ enablePagesAssetsServiceBinding?: EnablePagesAssetsServiceBindingOptions;
128
+ _?: (string | number)[];
129
+ $0?: string;
130
+ testScheduled?: boolean;
131
+ experimentalLocal?: boolean;
132
+ }
133
+
134
+ declare interface EnablePagesAssetsServiceBindingOptions {
135
+ proxyPort?: number;
136
+ directory?: string;
137
+ }
138
+
139
+ /**
140
+ * The `Environment` interface declares all the configuration fields that
141
+ * can be specified for an environment.
142
+ *
143
+ * This could be the top-level default environment, or a specific named environment.
144
+ */
145
+ declare interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
146
+ }
147
+
148
+ /**
149
+ * The `EnvironmentInheritable` interface declares all the configuration fields for an environment
150
+ * that can be inherited (and overridden) from the top-level environment.
151
+ */
152
+ declare interface EnvironmentInheritable {
153
+ /**
154
+ * The name of your worker. Alphanumeric + dashes only.
155
+ *
156
+ * @inheritable
157
+ */
158
+ name: string | undefined;
159
+ /**
160
+ * This is the ID of the account associated with your zone.
161
+ * You might have more than one account, so make sure to use
162
+ * the ID of the account associated with the zone/route you
163
+ * provide, if you provide one. It can also be specified through
164
+ * the CLOUDFLARE_ACCOUNT_ID environment variable.
165
+ *
166
+ * @inheritable
167
+ */
168
+ account_id: string | undefined;
169
+ /**
170
+ * A date in the form yyyy-mm-dd, which will be used to determine
171
+ * which version of the Workers runtime is used.
172
+ *
173
+ * More details at https://developers.cloudflare.com/workers/platform/compatibility-dates
174
+ *
175
+ * @inheritable
176
+ */
177
+ compatibility_date: string | undefined;
178
+ /**
179
+ * A list of flags that enable features from upcoming features of
180
+ * the Workers runtime, usually used together with compatibility_flags.
181
+ *
182
+ * More details at https://developers.cloudflare.com/workers/platform/compatibility-dates
183
+ *
184
+ * @inheritable
185
+ */
186
+ compatibility_flags: string[];
187
+ /**
188
+ * The entrypoint/path to the JavaScript file that will be executed.
189
+ */
190
+ main: string | undefined;
191
+ /**
192
+ * Whether we use <name>.<subdomain>.workers.dev to
193
+ * test and deploy your worker.
194
+ *
195
+ * @default `true` (This is a breaking change from wrangler 1)
196
+ * @breaking
197
+ * @inheritable
198
+ */
199
+ workers_dev: boolean | undefined;
200
+ /**
201
+ * A list of routes that your worker should be published to.
202
+ * Only one of `routes` or `route` is required.
203
+ *
204
+ * Only required when workers_dev is false, and there's no scheduled worker (see `triggers`)
205
+ *
206
+ * @inheritable
207
+ */
208
+ routes: Route[] | undefined;
209
+ /**
210
+ * A route that your worker should be published to. Literally
211
+ * the same as routes, but only one.
212
+ * Only one of `routes` or `route` is required.
213
+ *
214
+ * Only required when workers_dev is false, and there's no scheduled worker
215
+ *
216
+ * @inheritable
217
+ */
218
+ route: Route | undefined;
219
+ /**
220
+ * Path to a custom tsconfig
221
+ */
222
+ tsconfig: string | undefined;
223
+ /**
224
+ * The function to use to replace jsx syntax.
225
+ *
226
+ * @default `"React.createElement"`
227
+ * @inheritable
228
+ */
229
+ jsx_factory: string;
230
+ /**
231
+ * The function to use to replace jsx fragment syntax.
232
+ *
233
+ * @default `"React.Fragment"`
234
+ * @inheritable
235
+ */
236
+ jsx_fragment: string;
237
+ /**
238
+ * "Cron" definitions to trigger a worker's "scheduled" function.
239
+ *
240
+ * Lets you call workers periodically, much like a cron job.
241
+ *
242
+ * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
243
+ *
244
+ * @default `{crons:[]}`
245
+ * @inheritable
246
+ */
247
+ triggers: {
248
+ crons: string[];
249
+ };
250
+ /**
251
+ * Specifies the Usage Model for your Worker. There are two options -
252
+ * [bundled](https://developers.cloudflare.com/workers/platform/limits#bundled-usage-model) and
253
+ * [unbound](https://developers.cloudflare.com/workers/platform/limits#unbound-usage-model).
254
+ * For newly created Workers, if the Usage Model is omitted
255
+ * it will be set to the [default Usage Model set on the account](https://dash.cloudflare.com/?account=workers/default-usage-model).
256
+ * For existing Workers, if the Usage Model is omitted, it will be
257
+ * set to the Usage Model configured in the dashboard for that Worker.
258
+ *
259
+ * @inheritable
260
+ */
261
+ usage_model: "bundled" | "unbound" | undefined;
262
+ /**
263
+ * An ordered list of rules that define which modules to import,
264
+ * and what type to import them as. You will need to specify rules
265
+ * to use Text, Data, and CompiledWasm modules, or when you wish to
266
+ * have a .js file be treated as an ESModule instead of CommonJS.
267
+ *
268
+ * @inheritable
269
+ */
270
+ rules: Rule[];
271
+ /**
272
+ * Configures a custom build step to be run by Wrangler when building your Worker.
273
+ *
274
+ * Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
275
+ * for more details.
276
+ *
277
+ * @default {}
278
+ */
279
+ build: {
280
+ /** The command used to build your Worker. On Linux and macOS, the command is executed in the `sh` shell and the `cmd` shell for Windows. The `&&` and `||` shell operators may be used. */
281
+ command?: string;
282
+ /** The directory in which the command is executed. */
283
+ cwd?: string;
284
+ /** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
285
+ watch_dir?: string | string[];
286
+ /**
287
+ * Deprecated field previously used to configure the build and upload of the script.
288
+ * @deprecated
289
+ */
290
+ upload?: DeprecatedUpload;
291
+ };
292
+ /**
293
+ * Skip internal build steps and directly publish script
294
+ * @inheritable
295
+ */
296
+ no_bundle: boolean | undefined;
297
+ /**
298
+ * Minify the script before uploading.
299
+ * @inheritable
300
+ */
301
+ minify: boolean | undefined;
302
+ /**
303
+ * Add polyfills for node builtin modules and globals
304
+ * @inheritable
305
+ */
306
+ node_compat: boolean | undefined;
307
+ /**
308
+ * Specifies namespace bindings that are bound to this Worker environment.
309
+ *
310
+ * NOTE: This field is not automatically inherited from the top level environment,
311
+ * and so must be specified in every named environment.
312
+ *
313
+ * @default `[]`
314
+ * @nonInheritable
315
+ */
316
+ dispatch_namespaces: {
317
+ /** The binding name used to refer to the bound service. */
318
+ binding: string;
319
+ /** The namespace to bind to. */
320
+ namespace: string;
321
+ }[];
322
+ /**
323
+ * Designates this worker as an internal-only "first-party" worker.
324
+ */
325
+ first_party_worker: boolean | undefined;
326
+ /**
327
+ * TODO: remove this as it has been deprecated.
328
+ *
329
+ * This is just here for now because the `route` commands use it.
330
+ * So we need to include it in this type so it is available.
331
+ */
332
+ zone_id?: string;
333
+ /**
334
+ * Specify a compiled capnp schema to use
335
+ * Then add a binding per field in the top level message that you will send to logfwdr
336
+ *
337
+ * @default `{schema:undefined,bindings:[]}`
338
+ * @inheritable
339
+ */
340
+ logfwdr: {
341
+ /** capnp schema filename */
342
+ schema: string | undefined;
343
+ bindings: {
344
+ /** The binding name used to refer to logfwdr */
345
+ name: string;
346
+ /** The destination for this logged message */
347
+ destination: string;
348
+ }[];
349
+ };
350
+ /**
351
+ * Send Trace Events from this worker to Workers Logpush.
352
+ *
353
+ * This will not configure a corresponding Logpush job automatically.
354
+ *
355
+ * For more information about Workers Logpush, see:
356
+ * https://blog.cloudflare.com/logpush-for-workers/
357
+ *
358
+ * @inheritable
359
+ */
360
+ logpush: boolean | undefined;
361
+ }
362
+
363
+ /**
364
+ * The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
365
+ * that cannot be inherited from the top-level environment, and must be defined specifically.
366
+ *
367
+ * If any of these fields are defined at the top-level then they should also be specifically defined
368
+ * for each named environment.
369
+ */
370
+ declare interface EnvironmentNonInheritable {
371
+ /**
372
+ * A map of values to substitute when deploying your worker.
373
+ *
374
+ * NOTE: This field is not automatically inherited from the top level environment,
375
+ * and so must be specified in every named environment.
376
+ *
377
+ * @default `{}`
378
+ * @nonInheritable
379
+ */
380
+ define: Record<string, string>;
381
+ /**
382
+ * A map of environment variables to set when deploying your worker.
383
+ *
384
+ * NOTE: This field is not automatically inherited from the top level environment,
385
+ * and so must be specified in every named environment.
386
+ *
387
+ * @default `{}`
388
+ * @nonInheritable
389
+ */
390
+ vars: {
391
+ [key: string]: unknown;
392
+ };
393
+ /**
394
+ * Specifies namespace binding that is bound to this Worker environment.
395
+ * It allows for access at runtime to the Workers metadata.
396
+ * @default `undefined`
397
+ * @nonInheritable
398
+ **/
399
+ metadata_binding: string | undefined;
400
+ /**
401
+ * A list of durable objects that your worker should be bound to.
402
+ *
403
+ * For more information about Durable Objects, see the documentation at
404
+ * https://developers.cloudflare.com/workers/learning/using-durable-objects
405
+ *
406
+ * NOTE: This field is not automatically inherited from the top level environment,
407
+ * and so must be specified in every named environment.
408
+ *
409
+ * @default `{bindings:[]}`
410
+ * @nonInheritable
411
+ */
412
+ durable_objects: {
413
+ bindings: {
414
+ /** The name of the binding used to refer to the Durable Object */
415
+ name: string;
416
+ /** The exported class name of the Durable Object */
417
+ class_name: string;
418
+ /** The script where the Durable Object is defined (if it's external to this worker) */
419
+ script_name?: string;
420
+ /** The service environment of the script_name to bind to */
421
+ environment?: string;
422
+ }[];
423
+ };
424
+ /**
425
+ * These specify any Workers KV Namespaces you want to
426
+ * access from inside your Worker.
427
+ *
428
+ * To learn more about KV Namespaces,
429
+ * see the documentation at https://developers.cloudflare.com/workers/learning/how-kv-works
430
+ *
431
+ * NOTE: This field is not automatically inherited from the top level environment,
432
+ * and so must be specified in every named environment.
433
+ *
434
+ * @default `[]`
435
+ * @nonInheritable
436
+ */
437
+ kv_namespaces: {
438
+ /** The binding name used to refer to the KV Namespace */
439
+ binding: string;
440
+ /** The ID of the KV namespace */
441
+ id: string;
442
+ /** The ID of the KV namespace used during `wrangler dev` */
443
+ preview_id?: string;
444
+ }[];
445
+ /**
446
+ * Specifies Queues that are bound to this Worker environment.
447
+ *
448
+ * NOTE: This field is not automatically inherited from the top level environment,
449
+ * and so must be specified in every named environment.
450
+ *
451
+ * @default `{}`
452
+ * @nonInheritable
453
+ */
454
+ queues: {
455
+ /** Producer bindings */
456
+ producers?: {
457
+ /** The binding name used to refer to the Queue in the worker. */
458
+ binding: string;
459
+ /** The name of this Queue. */
460
+ queue: string;
461
+ }[];
462
+ /** Consumer configuration */
463
+ consumers?: {
464
+ /** The name of the queue from which this script should consume. */
465
+ queue: string;
466
+ /** The maximum number of messages per batch */
467
+ max_batch_size?: number;
468
+ /** The maximum number of seconds to wait to fill a batch with messages. */
469
+ max_batch_timeout?: number;
470
+ /** The maximum number of retries for each message. */
471
+ max_retries?: number;
472
+ /** The queue to send messages that failed to be consumed. */
473
+ dead_letter_queue?: string;
474
+ }[];
475
+ };
476
+ /**
477
+ * Specifies R2 buckets that are bound to this Worker environment.
478
+ *
479
+ * NOTE: This field is not automatically inherited from the top level environment,
480
+ * and so must be specified in every named environment.
481
+ *
482
+ * @default `[]`
483
+ * @nonInheritable
484
+ */
485
+ r2_buckets: {
486
+ /** The binding name used to refer to the R2 bucket in the worker. */
487
+ binding: string;
488
+ /** The name of this R2 bucket at the edge. */
489
+ bucket_name: string;
490
+ /** The preview name of this R2 bucket at the edge. */
491
+ preview_bucket_name?: string;
492
+ }[];
493
+ /**
494
+ * Specifies D1 databases that are bound to this Worker environment.
495
+ *
496
+ * NOTE: This field is not automatically inherited from the top level environment,
497
+ * and so must be specified in every named environment.
498
+ *
499
+ * @default `[]`
500
+ * @nonInheritable
501
+ */
502
+ d1_databases: {
503
+ /** The binding name used to refer to the D1 database in the worker. */
504
+ binding: string;
505
+ /** The name of this D1 database. */
506
+ database_name: string;
507
+ /** The UUID of this D1 database (not required). */
508
+ database_id: string;
509
+ /** The UUID of this D1 database for Wrangler Dev (if specified). */
510
+ preview_database_id?: string;
511
+ }[];
512
+ /**
513
+ * Specifies service bindings (worker-to-worker) that are bound to this Worker environment.
514
+ *
515
+ * NOTE: This field is not automatically inherited from the top level environment,
516
+ * and so must be specified in every named environment.
517
+ *
518
+ * @default `[]`
519
+ * @nonInheritable
520
+ */
521
+ services: {
522
+ /** The binding name used to refer to the bound service. */
523
+ binding: string;
524
+ /** The name of the service. */
525
+ service: string;
526
+ /** The environment of the service (e.g. production, staging, etc). */
527
+ environment?: string;
528
+ }[] | undefined;
529
+ /**
530
+ * "Unsafe" tables for features that aren't directly supported by wrangler.
531
+ *
532
+ * NOTE: This field is not automatically inherited from the top level environment,
533
+ * and so must be specified in every named environment.
534
+ *
535
+ * @default `{ bindings: [] }`
536
+ * @nonInheritable
537
+ */
538
+ unsafe: {
539
+ /**
540
+ * A set of bindings that should be put into a Worker's upload metadata without changes. These
541
+ * can be used to implement bindings for features that haven't released and aren't supported
542
+ * directly by wrangler or miniflare.
543
+ *
544
+ * @default []
545
+ */
546
+ bindings: {
547
+ name: string;
548
+ type: string;
549
+ [key: string]: unknown;
550
+ }[];
551
+ };
552
+ }
553
+
554
+ declare class File extends Blob_2 {
555
+ /**
556
+ * Creates a new File instance.
557
+ *
558
+ * @param fileBits An `Array` strings, or [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [`ArrayBufferView`](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView), [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects, or a mix of any of such objects, that will be put inside the [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File).
559
+ * @param fileName The name of the file.
560
+ * @param options An options object containing optional attributes for the file.
561
+ */
562
+ constructor(fileBits: ReadonlyArray<string | NodeJS.ArrayBufferView | Blob_2>, fileName: string, options?: FilePropertyBag)
563
+
564
+ /**
565
+ * Name of the file referenced by the File object.
566
+ */
567
+ readonly name: string
568
+
569
+ /**
570
+ * The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
571
+ */
572
+ readonly lastModified: number
573
+
574
+ readonly [Symbol.toStringTag]: string
575
+ }
576
+
577
+ declare interface FilePropertyBag extends BlobPropertyBag {
578
+ /**
579
+ * The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
580
+ */
581
+ lastModified?: number
582
+ }
583
+
584
+ /**
585
+ * 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().
586
+ */
587
+ declare class FormData {
588
+ /**
589
+ * Appends a new value onto an existing key inside a FormData object,
590
+ * or adds the key if it does not already exist.
591
+ *
592
+ * The difference between `set()` and `append()` is that if the specified key already exists, `set()` will overwrite all existing values with the new one, whereas `append()` will append the new value onto the end of the existing set of values.
593
+ *
594
+ * @param name The name of the field whose data is contained in `value`.
595
+ * @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
596
+ or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
597
+ * @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
598
+ */
599
+ append(name: string, value: unknown, fileName?: string): void
600
+
601
+ /**
602
+ * Set a new value for an existing key inside FormData,
603
+ * or add the new field if it does not already exist.
604
+ *
605
+ * @param name The name of the field whose data is contained in `value`.
606
+ * @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
607
+ or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
608
+ * @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
609
+ *
610
+ */
611
+ set(name: string, value: unknown, fileName?: string): void
612
+
613
+ /**
614
+ * Returns the first value associated with a given key from within a `FormData` object.
615
+ * If you expect multiple values and want all of them, use the `getAll()` method instead.
616
+ *
617
+ * @param {string} name A name of the value you want to retrieve.
618
+ *
619
+ * @returns A `FormDataEntryValue` containing the value. If the key doesn't exist, the method returns null.
620
+ */
621
+ get(name: string): FormDataEntryValue | null
622
+
623
+ /**
624
+ * Returns all the values associated with a given key from within a `FormData` object.
625
+ *
626
+ * @param {string} name A name of the value you want to retrieve.
627
+ *
628
+ * @returns An array of `FormDataEntryValue` whose key matches the value passed in the `name` parameter. If the key doesn't exist, the method returns an empty list.
629
+ */
630
+ getAll(name: string): FormDataEntryValue[]
631
+
632
+ /**
633
+ * Returns a boolean stating whether a `FormData` object contains a certain key.
634
+ *
635
+ * @param name A string representing the name of the key you want to test for.
636
+ *
637
+ * @return A boolean value.
638
+ */
639
+ has(name: string): boolean
640
+
641
+ /**
642
+ * Deletes a key and its value(s) from a `FormData` object.
643
+ *
644
+ * @param name The name of the key you want to delete.
645
+ */
646
+ delete(name: string): void
647
+
648
+ /**
649
+ * Executes given callback function for each field of the FormData instance
650
+ */
651
+ forEach: (
652
+ callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void,
653
+ thisArg?: unknown
654
+ ) => void
655
+
656
+ /**
657
+ * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all keys contained in this `FormData` object.
658
+ * Each key is a `string`.
659
+ */
660
+ keys: () => SpecIterableIterator<string>
661
+
662
+ /**
663
+ * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all values contained in this object `FormData` object.
664
+ * Each value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue).
665
+ */
666
+ values: () => SpecIterableIterator<FormDataEntryValue>
667
+
668
+ /**
669
+ * Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through the `FormData` key/value pairs.
670
+ * The key of each pair is a string; the value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue).
671
+ */
672
+ entries: () => SpecIterableIterator<[string, FormDataEntryValue]>
673
+
674
+ /**
675
+ * An alias for FormData#entries()
676
+ */
677
+ [Symbol.iterator]: () => SpecIterableIterator<[string, FormDataEntryValue]>
678
+
679
+ readonly [Symbol.toStringTag]: string
680
+ }
681
+
682
+ /**
683
+ * A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
684
+ */
685
+ declare type FormDataEntryValue = string | File
686
+
687
+ declare class Headers implements SpecIterable<[string, string]> {
688
+ constructor (init?: HeadersInit)
689
+ readonly append: (name: string, value: string) => void
690
+ readonly delete: (name: string) => void
691
+ readonly get: (name: string) => string | null
692
+ readonly has: (name: string) => boolean
693
+ readonly set: (name: string, value: string) => void
694
+ readonly forEach: (
695
+ callbackfn: (value: string, key: string, iterable: Headers) => void,
696
+ thisArg?: unknown
697
+ ) => void
698
+
699
+ readonly keys: () => SpecIterableIterator<string>
700
+ readonly values: () => SpecIterableIterator<string>
701
+ readonly entries: () => SpecIterableIterator<[string, string]>
702
+ readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
703
+ }
704
+
705
+ declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers
706
+
707
+ declare type ReferrerPolicy =
708
+ | ''
709
+ | 'no-referrer'
710
+ | 'no-referrer-when-downgrade'
711
+ | 'origin'
712
+ | 'origin-when-cross-origin'
713
+ | 'same-origin'
714
+ | 'strict-origin'
715
+ | 'strict-origin-when-cross-origin'
716
+ | 'unsafe-url';
717
+
718
+ declare class Request implements BodyMixin {
719
+ constructor (input: RequestInfo, init?: RequestInit)
720
+
721
+ readonly cache: RequestCache
722
+ readonly credentials: RequestCredentials
723
+ readonly destination: RequestDestination
724
+ readonly headers: Headers
725
+ readonly integrity: string
726
+ readonly method: string
727
+ readonly mode: RequestMode
728
+ readonly redirect: RequestRedirect
729
+ readonly referrerPolicy: string
730
+ readonly url: string
731
+
732
+ readonly keepalive: boolean
733
+ readonly signal: AbortSignal
734
+
735
+ readonly body: ReadableStream | null
736
+ readonly bodyUsed: boolean
737
+
738
+ readonly arrayBuffer: () => Promise<ArrayBuffer>
739
+ readonly blob: () => Promise<Blob_2>
740
+ readonly formData: () => Promise<FormData>
741
+ readonly json: () => Promise<unknown>
742
+ readonly text: () => Promise<string>
743
+
744
+ readonly clone: () => Request
745
+ }
746
+
747
+ declare type RequestCache =
748
+ | 'default'
749
+ | 'force-cache'
750
+ | 'no-cache'
751
+ | 'no-store'
752
+ | 'only-if-cached'
753
+ | 'reload'
754
+
755
+ declare type RequestCredentials = 'omit' | 'include' | 'same-origin'
756
+
757
+ declare type RequestDestination =
758
+ | ''
759
+ | 'audio'
760
+ | 'audioworklet'
761
+ | 'document'
762
+ | 'embed'
763
+ | 'font'
764
+ | 'image'
765
+ | 'manifest'
766
+ | 'object'
767
+ | 'paintworklet'
768
+ | 'report'
769
+ | 'script'
770
+ | 'sharedworker'
771
+ | 'style'
772
+ | 'track'
773
+ | 'video'
774
+ | 'worker'
775
+ | 'xslt'
776
+
777
+ declare type RequestInfo = string | URL_2 | Request
778
+
779
+ declare interface RequestInit {
780
+ method?: string
781
+ keepalive?: boolean
782
+ headers?: HeadersInit
783
+ body?: BodyInit
784
+ redirect?: RequestRedirect
785
+ integrity?: string
786
+ signal?: AbortSignal
787
+ credentials?: RequestCredentials
788
+ mode?: RequestMode
789
+ referrer?: string
790
+ referrerPolicy?: ReferrerPolicy
791
+ window?: null
792
+ dispatcher?: Dispatcher
793
+ }
794
+
795
+ declare type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
796
+
797
+ declare type RequestRedirect = 'error' | 'follow' | 'manual'
798
+
799
+ declare class Response implements BodyMixin {
800
+ constructor (body?: BodyInit, init?: ResponseInit)
801
+
802
+ readonly headers: Headers
803
+ readonly ok: boolean
804
+ readonly status: number
805
+ readonly statusText: string
806
+ readonly type: ResponseType
807
+ readonly url: string
808
+ readonly redirected: boolean
809
+
810
+ readonly body: ReadableStream | null
811
+ readonly bodyUsed: boolean
812
+
813
+ readonly arrayBuffer: () => Promise<ArrayBuffer>
814
+ readonly blob: () => Promise<Blob_2>
815
+ readonly formData: () => Promise<FormData>
816
+ readonly json: () => Promise<unknown>
817
+ readonly text: () => Promise<string>
818
+
819
+ readonly clone: () => Response
820
+
821
+ static error (): Response
822
+ static json(data: any, init?: ResponseInit): Response
823
+ static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response
824
+ }
825
+
826
+ declare interface ResponseInit {
827
+ readonly status?: number
828
+ readonly statusText?: string
829
+ readonly headers?: HeadersInit
830
+ }
831
+
832
+ declare type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308
833
+
834
+ declare type ResponseType =
835
+ | 'basic'
836
+ | 'cors'
837
+ | 'default'
838
+ | 'error'
839
+ | 'opaque'
840
+ | 'opaqueredirect'
841
+
842
+ declare type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
843
+
844
+ /**
845
+ * A bundling resolver rule, defining the modules type for paths that match the specified globs.
846
+ */
847
+ declare type Rule = {
848
+ type: ConfigModuleRuleType;
849
+ globs: string[];
850
+ fallthrough?: boolean;
851
+ };
852
+
853
+ declare type SimpleRoute = string;
854
+
855
+ declare interface SpecIterable<T> {
856
+ [Symbol.iterator](): SpecIterator<T>;
857
+ }
858
+
859
+ declare interface SpecIterableIterator<T> extends SpecIterator<T> {
860
+ [Symbol.iterator](): SpecIterableIterator<T>;
861
+ }
862
+
863
+ declare interface SpecIterator<T, TReturn = any, TNext = undefined> {
864
+ next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
865
+ }
866
+
867
+ /**
868
+ * unstable_dev starts a wrangler dev server, and returns a promise that resolves with utility functions to interact with it.
869
+ */
870
+ export declare function unstable_dev(script: string, options?: DevOptions, apiOptions?: DevApiOptions): Promise<UnstableDevWorker>;
871
+
872
+ export declare interface UnstableDevWorker {
873
+ port: number;
874
+ address: string;
875
+ stop: () => Promise<void>;
876
+ fetch: (input?: RequestInfo, init?: RequestInit) => Promise<Response>;
877
+ waitUntilExit: () => Promise<void>;
878
+ }
879
+
880
+ declare type ZoneIdRoute = {
881
+ pattern: string;
882
+ zone_id: string;
883
+ custom_domain?: boolean;
884
+ };
885
+
886
+ declare type ZoneNameRoute = {
887
+ pattern: string;
888
+ zone_name: string;
889
+ custom_domain?: boolean;
890
+ };
891
+
892
+ export { }