better-call 0.0.0-experimental.06264e12

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 (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +254 -0
  3. package/dist/error.cjs +67 -0
  4. package/dist/error.cjs.map +1 -0
  5. package/dist/error.d.cts +46 -0
  6. package/dist/error.d.mts +46 -0
  7. package/dist/error.mjs +64 -0
  8. package/dist/error.mjs.map +1 -0
  9. package/dist/fn.cjs +335 -0
  10. package/dist/fn.cjs.map +1 -0
  11. package/dist/fn.d.cts +312 -0
  12. package/dist/fn.d.mts +312 -0
  13. package/dist/fn.mjs +335 -0
  14. package/dist/fn.mjs.map +1 -0
  15. package/dist/index.cjs +37 -0
  16. package/dist/index.cjs.map +1 -0
  17. package/dist/index.d.cts +46 -0
  18. package/dist/index.d.mts +46 -0
  19. package/dist/index.mjs +24 -0
  20. package/dist/index.mjs.map +1 -0
  21. package/dist/module.cjs +111 -0
  22. package/dist/module.cjs.map +1 -0
  23. package/dist/module.d.cts +249 -0
  24. package/dist/module.d.mts +249 -0
  25. package/dist/module.mjs +102 -0
  26. package/dist/module.mjs.map +1 -0
  27. package/dist/plugins/http.cjs +185 -0
  28. package/dist/plugins/http.cjs.map +1 -0
  29. package/dist/plugins/http.d.cts +1261 -0
  30. package/dist/plugins/http.d.mts +1261 -0
  31. package/dist/plugins/http.mjs +175 -0
  32. package/dist/plugins/http.mjs.map +1 -0
  33. package/dist/plugins/read-only.cjs +19 -0
  34. package/dist/plugins/read-only.cjs.map +1 -0
  35. package/dist/plugins/read-only.d.cts +17 -0
  36. package/dist/plugins/read-only.d.mts +17 -0
  37. package/dist/plugins/read-only.mjs +19 -0
  38. package/dist/plugins/read-only.mjs.map +1 -0
  39. package/dist/schema.cjs +167 -0
  40. package/dist/schema.cjs.map +1 -0
  41. package/dist/schema.d.cts +225 -0
  42. package/dist/schema.d.mts +225 -0
  43. package/dist/schema.mjs +159 -0
  44. package/dist/schema.mjs.map +1 -0
  45. package/dist/scope.d.cts +18 -0
  46. package/dist/scope.d.mts +18 -0
  47. package/dist/storage.cjs +256 -0
  48. package/dist/storage.cjs.map +1 -0
  49. package/dist/storage.d.cts +195 -0
  50. package/dist/storage.d.mts +195 -0
  51. package/dist/storage.mjs +253 -0
  52. package/dist/storage.mjs.map +1 -0
  53. package/dist/types.d.cts +8 -0
  54. package/dist/types.d.mts +8 -0
  55. package/dist/var.cjs +162 -0
  56. package/dist/var.cjs.map +1 -0
  57. package/dist/var.d.cts +36 -0
  58. package/dist/var.d.mts +36 -0
  59. package/dist/var.mjs +154 -0
  60. package/dist/var.mjs.map +1 -0
  61. package/package.json +92 -0
@@ -0,0 +1,1261 @@
1
+ import { InferArgs, TypeDefination } from "../schema.cjs";
2
+ import { VarDefination } from "../var.cjs";
3
+ import { FnDefination } from "../fn.cjs";
4
+ //#region src/plugins/http.d.ts
5
+ /** The whole request-side state, as ONE value: `c.req` and
6
+ * everything is there - no per-piece vars to require one by one. */
7
+ type HttpRequest = {
8
+ /** The fetch Request itself, untouched. */
9
+ raw: Request;
10
+ method: string;
11
+ path: string;
12
+ headers: Headers;
13
+ query: Record<string, string | string[]>;
14
+ cookies: Record<string, string>;
15
+ /** Parsed by `fromRequest` when the content type says json/text -
16
+ * anything else stays on `raw`. */
17
+ body: unknown;
18
+ };
19
+ /** Build the `req` value from a fetch Request. The body cannot be read
20
+ * synchronously, so it comes in from whoever already awaited it -
21
+ * `fromRequest` does that for you. */
22
+ declare const toHttpRequest: (raw: Request, body?: unknown) => HttpRequest;
23
+ declare const req: VarDefination<"req", HttpRequest | null, undefined, never>;
24
+ /** The response side, as ONE value. `headers` and `status` are meant to
25
+ * be MUTATED in place (`res.headers.set(...)`, `res.status = 201`) - the
26
+ * object is shared with whoever builds the final Response, so in-place
27
+ * writes are exactly what travels back. */
28
+ type HttpResponse = {
29
+ headers: Headers;
30
+ /** Steers the answering Response's status - assign it in place. */
31
+ status?: number;
32
+ statusText?: string;
33
+ };
34
+ declare const res: VarDefination<"res", HttpResponse | null, undefined, never>;
35
+ declare const fromRequest: FnDefination<{
36
+ readonly request: Request;
37
+ }, Promise<{
38
+ method: string;
39
+ path: string;
40
+ }>, "http.from_request", {
41
+ readonly request: TypeDefination<Request, Request, never>;
42
+ }, readonly ["req"], {}, {
43
+ req?: ({
44
+ raw: {
45
+ readonly cache: RequestCache;
46
+ readonly credentials: RequestCredentials;
47
+ readonly destination: RequestDestination;
48
+ readonly headers: {
49
+ append: (name: string, value: string) => void;
50
+ delete: (name: string) => void;
51
+ get: (name: string) => string | null;
52
+ getSetCookie: () => string[];
53
+ has: (name: string) => boolean;
54
+ set: (name: string, value: string) => void;
55
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
56
+ entries: () => HeadersIterator<[string, string]>;
57
+ keys: () => HeadersIterator<string>;
58
+ values: () => HeadersIterator<string>;
59
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
60
+ };
61
+ readonly integrity: string;
62
+ readonly keepalive: boolean;
63
+ readonly method: string;
64
+ readonly mode: RequestMode;
65
+ readonly redirect: RequestRedirect;
66
+ readonly referrer: string;
67
+ readonly referrerPolicy: ReferrerPolicy;
68
+ readonly signal: {
69
+ readonly aborted: boolean;
70
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
71
+ readonly reason: any;
72
+ throwIfAborted: () => void;
73
+ addEventListener: {
74
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
75
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
76
+ };
77
+ removeEventListener: {
78
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
79
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
80
+ };
81
+ dispatchEvent: (event: Event) => boolean;
82
+ };
83
+ readonly url: string;
84
+ clone: () => Request;
85
+ readonly body: {
86
+ readonly locked: boolean;
87
+ cancel: (reason?: any) => Promise<void>;
88
+ getReader: {
89
+ (options: {
90
+ mode: "byob";
91
+ }): ReadableStreamBYOBReader;
92
+ (): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
93
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
94
+ };
95
+ pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
96
+ pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
97
+ tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
98
+ values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
99
+ [Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
100
+ } | null;
101
+ readonly bodyUsed: boolean;
102
+ arrayBuffer: () => Promise<ArrayBuffer>;
103
+ blob: () => Promise<Blob>;
104
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
105
+ formData: () => Promise<FormData>;
106
+ json: () => Promise<any>;
107
+ text: () => Promise<string>;
108
+ };
109
+ method: string;
110
+ path: string;
111
+ headers: {
112
+ append: (name: string, value: string) => void;
113
+ delete: (name: string) => void;
114
+ get: (name: string) => string | null;
115
+ getSetCookie: () => string[];
116
+ has: (name: string) => boolean;
117
+ set: (name: string, value: string) => void;
118
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
119
+ entries: () => HeadersIterator<[string, string]>;
120
+ keys: () => HeadersIterator<string>;
121
+ values: () => HeadersIterator<string>;
122
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
123
+ };
124
+ query: {
125
+ [x: string]: string | string[];
126
+ };
127
+ cookies: {
128
+ [x: string]: string;
129
+ };
130
+ body: unknown;
131
+ } & HttpRequest) | null | undefined;
132
+ res?: ({
133
+ headers: {
134
+ append: (name: string, value: string) => void;
135
+ delete: (name: string) => void;
136
+ get: (name: string) => string | null;
137
+ getSetCookie: () => string[];
138
+ has: (name: string) => boolean;
139
+ set: (name: string, value: string) => void;
140
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
141
+ entries: () => HeadersIterator<[string, string]>;
142
+ keys: () => HeadersIterator<string>;
143
+ values: () => HeadersIterator<string>;
144
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
145
+ };
146
+ status?: number | undefined;
147
+ statusText?: string | undefined;
148
+ } & HttpResponse) | null | undefined;
149
+ }, unknown>;
150
+ /** Cookie attributes as a SCHEMA - the source of truth. The TS type
151
+ * falls out of it, and everything crossing a fn door validates against
152
+ * it (enum-checked sameSite, `instanceof`-checked expires). */
153
+ declare const cookieShape: {
154
+ maxAge: TypeDefination<number, number | undefined, undefined>;
155
+ expires: TypeDefination<Date, Date | undefined, undefined>;
156
+ path: TypeDefination<string, string | undefined, undefined>;
157
+ domain: TypeDefination<string, string | undefined, undefined>;
158
+ secure: TypeDefination<boolean, boolean | undefined, undefined>;
159
+ httpOnly: TypeDefination<boolean, boolean | undefined, undefined>;
160
+ sameSite: TypeDefination<"strict" | "lax" | "none", "strict" | "lax" | "none" | undefined, undefined>;
161
+ };
162
+ type CookieOptions = InferArgs<typeof cookieShape>;
163
+ /**
164
+ * Scope-level cookie DEFAULTS, as a var: whatever sets it - app setup, a
165
+ * module, an interceptor - every `setCookie` below merges its per-call
166
+ * options ON TOP. Config that travels down the call tree is exactly what
167
+ * a var is, so "change the global cookie config" is just a `.set()` at
168
+ * any point in the scope.
169
+ */
170
+ declare const cookieOptions: VarDefination<"cookieOptions", {
171
+ maxAge?: number | undefined;
172
+ expires?: Date | undefined;
173
+ path?: string | undefined;
174
+ domain?: string | undefined;
175
+ secure?: boolean | undefined;
176
+ httpOnly?: boolean | undefined;
177
+ sameSite?: "strict" | "lax" | "none" | undefined;
178
+ }, TypeDefination<{
179
+ maxAge?: number | undefined;
180
+ expires?: Date | undefined;
181
+ path?: string | undefined;
182
+ domain?: string | undefined;
183
+ secure?: boolean | undefined;
184
+ httpOnly?: boolean | undefined;
185
+ sameSite?: "strict" | "lax" | "none" | undefined;
186
+ }, {
187
+ maxAge?: number | undefined;
188
+ expires?: Date | undefined;
189
+ path?: string | undefined;
190
+ domain?: string | undefined;
191
+ secure?: boolean | undefined;
192
+ httpOnly?: boolean | undefined;
193
+ sameSite?: "strict" | "lax" | "none" | undefined;
194
+ }, never>, never>;
195
+ /** Read one cookie from the REQUEST jar. Positional: `getCookie("theme")`.
196
+ * Readonly - reading a cookie can never write the scope. */
197
+ declare const getCookie: FnDefination<[string], string | null, "cookie.get", readonly [TypeDefination<string, string, never>], readonly [], {}, {
198
+ req?: ({
199
+ raw: {
200
+ readonly cache: RequestCache;
201
+ readonly credentials: RequestCredentials;
202
+ readonly destination: RequestDestination;
203
+ readonly headers: {
204
+ append: (name: string, value: string) => void;
205
+ delete: (name: string) => void;
206
+ get: (name: string) => string | null;
207
+ getSetCookie: () => string[];
208
+ has: (name: string) => boolean;
209
+ set: (name: string, value: string) => void;
210
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
211
+ entries: () => HeadersIterator<[string, string]>;
212
+ keys: () => HeadersIterator<string>;
213
+ values: () => HeadersIterator<string>;
214
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
215
+ };
216
+ readonly integrity: string;
217
+ readonly keepalive: boolean;
218
+ readonly method: string;
219
+ readonly mode: RequestMode;
220
+ readonly redirect: RequestRedirect;
221
+ readonly referrer: string;
222
+ readonly referrerPolicy: ReferrerPolicy;
223
+ readonly signal: {
224
+ readonly aborted: boolean;
225
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
226
+ readonly reason: any;
227
+ throwIfAborted: () => void;
228
+ addEventListener: {
229
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
230
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
231
+ };
232
+ removeEventListener: {
233
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
234
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
235
+ };
236
+ dispatchEvent: (event: Event) => boolean;
237
+ };
238
+ readonly url: string;
239
+ clone: () => Request;
240
+ readonly body: {
241
+ readonly locked: boolean;
242
+ cancel: (reason?: any) => Promise<void>;
243
+ getReader: {
244
+ (options: {
245
+ mode: "byob";
246
+ }): ReadableStreamBYOBReader;
247
+ (): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
248
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
249
+ };
250
+ pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
251
+ pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
252
+ tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
253
+ values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
254
+ [Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
255
+ } | null;
256
+ readonly bodyUsed: boolean;
257
+ arrayBuffer: () => Promise<ArrayBuffer>;
258
+ blob: () => Promise<Blob>;
259
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
260
+ formData: () => Promise<FormData>;
261
+ json: () => Promise<any>;
262
+ text: () => Promise<string>;
263
+ };
264
+ method: string;
265
+ path: string;
266
+ headers: {
267
+ append: (name: string, value: string) => void;
268
+ delete: (name: string) => void;
269
+ get: (name: string) => string | null;
270
+ getSetCookie: () => string[];
271
+ has: (name: string) => boolean;
272
+ set: (name: string, value: string) => void;
273
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
274
+ entries: () => HeadersIterator<[string, string]>;
275
+ keys: () => HeadersIterator<string>;
276
+ values: () => HeadersIterator<string>;
277
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
278
+ };
279
+ query: {
280
+ [x: string]: string | string[];
281
+ };
282
+ cookies: {
283
+ [x: string]: string;
284
+ };
285
+ body: unknown;
286
+ } & HttpRequest) | null | undefined;
287
+ res?: ({
288
+ headers: {
289
+ append: (name: string, value: string) => void;
290
+ delete: (name: string) => void;
291
+ get: (name: string) => string | null;
292
+ getSetCookie: () => string[];
293
+ has: (name: string) => boolean;
294
+ set: (name: string, value: string) => void;
295
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
296
+ entries: () => HeadersIterator<[string, string]>;
297
+ keys: () => HeadersIterator<string>;
298
+ values: () => HeadersIterator<string>;
299
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
300
+ };
301
+ status?: number | undefined;
302
+ statusText?: string | undefined;
303
+ } & HttpResponse) | null | undefined;
304
+ cookieOptions?: ({
305
+ maxAge?: number | undefined;
306
+ expires?: Date | undefined;
307
+ path?: string | undefined;
308
+ domain?: string | undefined;
309
+ secure?: boolean | undefined;
310
+ httpOnly?: boolean | undefined;
311
+ sameSite?: "strict" | "lax" | "none" | undefined;
312
+ } & {
313
+ maxAge?: number | undefined;
314
+ expires?: Date | undefined;
315
+ path?: string | undefined;
316
+ domain?: string | undefined;
317
+ secure?: boolean | undefined;
318
+ httpOnly?: boolean | undefined;
319
+ sameSite?: "strict" | "lax" | "none" | undefined;
320
+ }) | undefined;
321
+ }, unknown>;
322
+ /** Queue a Set-Cookie on the scope's response headers: the scope's
323
+ * `cookieOptions` defaults, with per-call options merged on top. The
324
+ * written cookie also lands in the request jar, so a later `getCookie`
325
+ * in the same scope reads what was set. */
326
+ declare const setCookie: FnDefination<{
327
+ readonly name: string;
328
+ readonly value: string;
329
+ readonly options?: {
330
+ maxAge?: number | undefined;
331
+ expires?: Date | undefined;
332
+ path?: string | undefined;
333
+ domain?: string | undefined;
334
+ secure?: boolean | undefined;
335
+ httpOnly?: boolean | undefined;
336
+ sameSite?: "strict" | "lax" | "none" | undefined;
337
+ } | undefined;
338
+ }, {
339
+ set: boolean;
340
+ }, "cookie.set", {
341
+ readonly name: TypeDefination<string, string, never>;
342
+ readonly value: TypeDefination<string, string, never>;
343
+ readonly options: TypeDefination<{
344
+ maxAge?: number | undefined;
345
+ expires?: Date | undefined;
346
+ path?: string | undefined;
347
+ domain?: string | undefined;
348
+ secure?: boolean | undefined;
349
+ httpOnly?: boolean | undefined;
350
+ sameSite?: "strict" | "lax" | "none" | undefined;
351
+ }, {
352
+ maxAge?: number | undefined;
353
+ expires?: Date | undefined;
354
+ path?: string | undefined;
355
+ domain?: string | undefined;
356
+ secure?: boolean | undefined;
357
+ httpOnly?: boolean | undefined;
358
+ sameSite?: "strict" | "lax" | "none" | undefined;
359
+ } | undefined, undefined>;
360
+ }, readonly [], {}, {
361
+ req?: ({
362
+ raw: {
363
+ readonly cache: RequestCache;
364
+ readonly credentials: RequestCredentials;
365
+ readonly destination: RequestDestination;
366
+ readonly headers: {
367
+ append: (name: string, value: string) => void;
368
+ delete: (name: string) => void;
369
+ get: (name: string) => string | null;
370
+ getSetCookie: () => string[];
371
+ has: (name: string) => boolean;
372
+ set: (name: string, value: string) => void;
373
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
374
+ entries: () => HeadersIterator<[string, string]>;
375
+ keys: () => HeadersIterator<string>;
376
+ values: () => HeadersIterator<string>;
377
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
378
+ };
379
+ readonly integrity: string;
380
+ readonly keepalive: boolean;
381
+ readonly method: string;
382
+ readonly mode: RequestMode;
383
+ readonly redirect: RequestRedirect;
384
+ readonly referrer: string;
385
+ readonly referrerPolicy: ReferrerPolicy;
386
+ readonly signal: {
387
+ readonly aborted: boolean;
388
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
389
+ readonly reason: any;
390
+ throwIfAborted: () => void;
391
+ addEventListener: {
392
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
393
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
394
+ };
395
+ removeEventListener: {
396
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
397
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
398
+ };
399
+ dispatchEvent: (event: Event) => boolean;
400
+ };
401
+ readonly url: string;
402
+ clone: () => Request;
403
+ readonly body: {
404
+ readonly locked: boolean;
405
+ cancel: (reason?: any) => Promise<void>;
406
+ getReader: {
407
+ (options: {
408
+ mode: "byob";
409
+ }): ReadableStreamBYOBReader;
410
+ (): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
411
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
412
+ };
413
+ pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
414
+ pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
415
+ tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
416
+ values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
417
+ [Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
418
+ } | null;
419
+ readonly bodyUsed: boolean;
420
+ arrayBuffer: () => Promise<ArrayBuffer>;
421
+ blob: () => Promise<Blob>;
422
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
423
+ formData: () => Promise<FormData>;
424
+ json: () => Promise<any>;
425
+ text: () => Promise<string>;
426
+ };
427
+ method: string;
428
+ path: string;
429
+ headers: {
430
+ append: (name: string, value: string) => void;
431
+ delete: (name: string) => void;
432
+ get: (name: string) => string | null;
433
+ getSetCookie: () => string[];
434
+ has: (name: string) => boolean;
435
+ set: (name: string, value: string) => void;
436
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
437
+ entries: () => HeadersIterator<[string, string]>;
438
+ keys: () => HeadersIterator<string>;
439
+ values: () => HeadersIterator<string>;
440
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
441
+ };
442
+ query: {
443
+ [x: string]: string | string[];
444
+ };
445
+ cookies: {
446
+ [x: string]: string;
447
+ };
448
+ body: unknown;
449
+ } & HttpRequest) | null | undefined;
450
+ res?: ({
451
+ headers: {
452
+ append: (name: string, value: string) => void;
453
+ delete: (name: string) => void;
454
+ get: (name: string) => string | null;
455
+ getSetCookie: () => string[];
456
+ has: (name: string) => boolean;
457
+ set: (name: string, value: string) => void;
458
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
459
+ entries: () => HeadersIterator<[string, string]>;
460
+ keys: () => HeadersIterator<string>;
461
+ values: () => HeadersIterator<string>;
462
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
463
+ };
464
+ status?: number | undefined;
465
+ statusText?: string | undefined;
466
+ } & HttpResponse) | null | undefined;
467
+ cookieOptions?: ({
468
+ maxAge?: number | undefined;
469
+ expires?: Date | undefined;
470
+ path?: string | undefined;
471
+ domain?: string | undefined;
472
+ secure?: boolean | undefined;
473
+ httpOnly?: boolean | undefined;
474
+ sameSite?: "strict" | "lax" | "none" | undefined;
475
+ } & {
476
+ maxAge?: number | undefined;
477
+ expires?: Date | undefined;
478
+ path?: string | undefined;
479
+ domain?: string | undefined;
480
+ secure?: boolean | undefined;
481
+ httpOnly?: boolean | undefined;
482
+ sameSite?: "strict" | "lax" | "none" | undefined;
483
+ }) | undefined;
484
+ }, unknown>;
485
+ /** Expire a cookie: a Set-Cookie with Max-Age=0 - the attributes (path,
486
+ * domain) must match the ones it was set with. */
487
+ declare const deleteCookie: FnDefination<{
488
+ readonly name: string;
489
+ readonly options?: {
490
+ maxAge?: number | undefined;
491
+ expires?: Date | undefined;
492
+ path?: string | undefined;
493
+ domain?: string | undefined;
494
+ secure?: boolean | undefined;
495
+ httpOnly?: boolean | undefined;
496
+ sameSite?: "strict" | "lax" | "none" | undefined;
497
+ } | undefined;
498
+ }, {
499
+ set: boolean;
500
+ }, "cookie.delete", {
501
+ readonly name: TypeDefination<string, string, never>;
502
+ readonly options: TypeDefination<{
503
+ maxAge?: number | undefined;
504
+ expires?: Date | undefined;
505
+ path?: string | undefined;
506
+ domain?: string | undefined;
507
+ secure?: boolean | undefined;
508
+ httpOnly?: boolean | undefined;
509
+ sameSite?: "strict" | "lax" | "none" | undefined;
510
+ }, {
511
+ maxAge?: number | undefined;
512
+ expires?: Date | undefined;
513
+ path?: string | undefined;
514
+ domain?: string | undefined;
515
+ secure?: boolean | undefined;
516
+ httpOnly?: boolean | undefined;
517
+ sameSite?: "strict" | "lax" | "none" | undefined;
518
+ } | undefined, undefined>;
519
+ }, readonly [], {}, {
520
+ req?: ({
521
+ raw: {
522
+ readonly cache: RequestCache;
523
+ readonly credentials: RequestCredentials;
524
+ readonly destination: RequestDestination;
525
+ readonly headers: {
526
+ append: (name: string, value: string) => void;
527
+ delete: (name: string) => void;
528
+ get: (name: string) => string | null;
529
+ getSetCookie: () => string[];
530
+ has: (name: string) => boolean;
531
+ set: (name: string, value: string) => void;
532
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
533
+ entries: () => HeadersIterator<[string, string]>;
534
+ keys: () => HeadersIterator<string>;
535
+ values: () => HeadersIterator<string>;
536
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
537
+ };
538
+ readonly integrity: string;
539
+ readonly keepalive: boolean;
540
+ readonly method: string;
541
+ readonly mode: RequestMode;
542
+ readonly redirect: RequestRedirect;
543
+ readonly referrer: string;
544
+ readonly referrerPolicy: ReferrerPolicy;
545
+ readonly signal: {
546
+ readonly aborted: boolean;
547
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
548
+ readonly reason: any;
549
+ throwIfAborted: () => void;
550
+ addEventListener: {
551
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
552
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
553
+ };
554
+ removeEventListener: {
555
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
556
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
557
+ };
558
+ dispatchEvent: (event: Event) => boolean;
559
+ };
560
+ readonly url: string;
561
+ clone: () => Request;
562
+ readonly body: {
563
+ readonly locked: boolean;
564
+ cancel: (reason?: any) => Promise<void>;
565
+ getReader: {
566
+ (options: {
567
+ mode: "byob";
568
+ }): ReadableStreamBYOBReader;
569
+ (): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
570
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
571
+ };
572
+ pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
573
+ pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
574
+ tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
575
+ values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
576
+ [Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
577
+ } | null;
578
+ readonly bodyUsed: boolean;
579
+ arrayBuffer: () => Promise<ArrayBuffer>;
580
+ blob: () => Promise<Blob>;
581
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
582
+ formData: () => Promise<FormData>;
583
+ json: () => Promise<any>;
584
+ text: () => Promise<string>;
585
+ };
586
+ method: string;
587
+ path: string;
588
+ headers: {
589
+ append: (name: string, value: string) => void;
590
+ delete: (name: string) => void;
591
+ get: (name: string) => string | null;
592
+ getSetCookie: () => string[];
593
+ has: (name: string) => boolean;
594
+ set: (name: string, value: string) => void;
595
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
596
+ entries: () => HeadersIterator<[string, string]>;
597
+ keys: () => HeadersIterator<string>;
598
+ values: () => HeadersIterator<string>;
599
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
600
+ };
601
+ query: {
602
+ [x: string]: string | string[];
603
+ };
604
+ cookies: {
605
+ [x: string]: string;
606
+ };
607
+ body: unknown;
608
+ } & HttpRequest) | null | undefined;
609
+ res?: ({
610
+ headers: {
611
+ append: (name: string, value: string) => void;
612
+ delete: (name: string) => void;
613
+ get: (name: string) => string | null;
614
+ getSetCookie: () => string[];
615
+ has: (name: string) => boolean;
616
+ set: (name: string, value: string) => void;
617
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
618
+ entries: () => HeadersIterator<[string, string]>;
619
+ keys: () => HeadersIterator<string>;
620
+ values: () => HeadersIterator<string>;
621
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
622
+ };
623
+ status?: number | undefined;
624
+ statusText?: string | undefined;
625
+ } & HttpResponse) | null | undefined;
626
+ cookieOptions?: ({
627
+ maxAge?: number | undefined;
628
+ expires?: Date | undefined;
629
+ path?: string | undefined;
630
+ domain?: string | undefined;
631
+ secure?: boolean | undefined;
632
+ httpOnly?: boolean | undefined;
633
+ sameSite?: "strict" | "lax" | "none" | undefined;
634
+ } & {
635
+ maxAge?: number | undefined;
636
+ expires?: Date | undefined;
637
+ path?: string | undefined;
638
+ domain?: string | undefined;
639
+ secure?: boolean | undefined;
640
+ httpOnly?: boolean | undefined;
641
+ sameSite?: "strict" | "lax" | "none" | undefined;
642
+ }) | undefined;
643
+ readonly setCookie?: ((input: {
644
+ readonly name: string;
645
+ readonly value: string;
646
+ readonly options?: {
647
+ maxAge?: number | undefined;
648
+ expires?: Date | undefined;
649
+ path?: string | undefined;
650
+ domain?: string | undefined;
651
+ secure?: boolean | undefined;
652
+ httpOnly?: boolean | undefined;
653
+ sameSite?: "strict" | "lax" | "none" | undefined;
654
+ } | undefined;
655
+ }) => {
656
+ set: boolean;
657
+ }) | undefined;
658
+ }, unknown>;
659
+ declare const http: {
660
+ cookieOptions: VarDefination<"cookieOptions", {
661
+ maxAge?: number | undefined;
662
+ expires?: Date | undefined;
663
+ path?: string | undefined;
664
+ domain?: string | undefined;
665
+ secure?: boolean | undefined;
666
+ httpOnly?: boolean | undefined;
667
+ sameSite?: "strict" | "lax" | "none" | undefined;
668
+ }, TypeDefination<{
669
+ maxAge?: number | undefined;
670
+ expires?: Date | undefined;
671
+ path?: string | undefined;
672
+ domain?: string | undefined;
673
+ secure?: boolean | undefined;
674
+ httpOnly?: boolean | undefined;
675
+ sameSite?: "strict" | "lax" | "none" | undefined;
676
+ }, {
677
+ maxAge?: number | undefined;
678
+ expires?: Date | undefined;
679
+ path?: string | undefined;
680
+ domain?: string | undefined;
681
+ secure?: boolean | undefined;
682
+ httpOnly?: boolean | undefined;
683
+ sameSite?: "strict" | "lax" | "none" | undefined;
684
+ }, never>, never>;
685
+ handler: FnDefination<{
686
+ readonly request: Request;
687
+ }, Promise<{
688
+ method: string;
689
+ path: string;
690
+ }>, "http.from_request", {
691
+ readonly request: TypeDefination<Request, Request, never>;
692
+ }, readonly ["req"], {}, {
693
+ req?: ({
694
+ raw: {
695
+ readonly cache: RequestCache;
696
+ readonly credentials: RequestCredentials;
697
+ readonly destination: RequestDestination;
698
+ readonly headers: {
699
+ append: (name: string, value: string) => void;
700
+ delete: (name: string) => void;
701
+ get: (name: string) => string | null;
702
+ getSetCookie: () => string[];
703
+ has: (name: string) => boolean;
704
+ set: (name: string, value: string) => void;
705
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
706
+ entries: () => HeadersIterator<[string, string]>;
707
+ keys: () => HeadersIterator<string>;
708
+ values: () => HeadersIterator<string>;
709
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
710
+ };
711
+ readonly integrity: string;
712
+ readonly keepalive: boolean;
713
+ readonly method: string;
714
+ readonly mode: RequestMode;
715
+ readonly redirect: RequestRedirect;
716
+ readonly referrer: string;
717
+ readonly referrerPolicy: ReferrerPolicy;
718
+ readonly signal: {
719
+ readonly aborted: boolean;
720
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
721
+ readonly reason: any;
722
+ throwIfAborted: () => void;
723
+ addEventListener: {
724
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
725
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
726
+ };
727
+ removeEventListener: {
728
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
729
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
730
+ };
731
+ dispatchEvent: (event: Event) => boolean;
732
+ };
733
+ readonly url: string;
734
+ clone: () => Request;
735
+ readonly body: {
736
+ readonly locked: boolean;
737
+ cancel: (reason?: any) => Promise<void>;
738
+ getReader: {
739
+ (options: {
740
+ mode: "byob";
741
+ }): ReadableStreamBYOBReader;
742
+ (): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
743
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
744
+ };
745
+ pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
746
+ pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
747
+ tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
748
+ values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
749
+ [Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
750
+ } | null;
751
+ readonly bodyUsed: boolean;
752
+ arrayBuffer: () => Promise<ArrayBuffer>;
753
+ blob: () => Promise<Blob>;
754
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
755
+ formData: () => Promise<FormData>;
756
+ json: () => Promise<any>;
757
+ text: () => Promise<string>;
758
+ };
759
+ method: string;
760
+ path: string;
761
+ headers: {
762
+ append: (name: string, value: string) => void;
763
+ delete: (name: string) => void;
764
+ get: (name: string) => string | null;
765
+ getSetCookie: () => string[];
766
+ has: (name: string) => boolean;
767
+ set: (name: string, value: string) => void;
768
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
769
+ entries: () => HeadersIterator<[string, string]>;
770
+ keys: () => HeadersIterator<string>;
771
+ values: () => HeadersIterator<string>;
772
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
773
+ };
774
+ query: {
775
+ [x: string]: string | string[];
776
+ };
777
+ cookies: {
778
+ [x: string]: string;
779
+ };
780
+ body: unknown;
781
+ } & HttpRequest) | null | undefined;
782
+ res?: ({
783
+ headers: {
784
+ append: (name: string, value: string) => void;
785
+ delete: (name: string) => void;
786
+ get: (name: string) => string | null;
787
+ getSetCookie: () => string[];
788
+ has: (name: string) => boolean;
789
+ set: (name: string, value: string) => void;
790
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
791
+ entries: () => HeadersIterator<[string, string]>;
792
+ keys: () => HeadersIterator<string>;
793
+ values: () => HeadersIterator<string>;
794
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
795
+ };
796
+ status?: number | undefined;
797
+ statusText?: string | undefined;
798
+ } & HttpResponse) | null | undefined;
799
+ }, unknown>;
800
+ getCookie: FnDefination<[string], string | null, "cookie.get", readonly [TypeDefination<string, string, never>], readonly [], {}, {
801
+ req?: ({
802
+ raw: {
803
+ readonly cache: RequestCache;
804
+ readonly credentials: RequestCredentials;
805
+ readonly destination: RequestDestination;
806
+ readonly headers: {
807
+ append: (name: string, value: string) => void;
808
+ delete: (name: string) => void;
809
+ get: (name: string) => string | null;
810
+ getSetCookie: () => string[];
811
+ has: (name: string) => boolean;
812
+ set: (name: string, value: string) => void;
813
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
814
+ entries: () => HeadersIterator<[string, string]>;
815
+ keys: () => HeadersIterator<string>;
816
+ values: () => HeadersIterator<string>;
817
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
818
+ };
819
+ readonly integrity: string;
820
+ readonly keepalive: boolean;
821
+ readonly method: string;
822
+ readonly mode: RequestMode;
823
+ readonly redirect: RequestRedirect;
824
+ readonly referrer: string;
825
+ readonly referrerPolicy: ReferrerPolicy;
826
+ readonly signal: {
827
+ readonly aborted: boolean;
828
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
829
+ readonly reason: any;
830
+ throwIfAborted: () => void;
831
+ addEventListener: {
832
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
833
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
834
+ };
835
+ removeEventListener: {
836
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
837
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
838
+ };
839
+ dispatchEvent: (event: Event) => boolean;
840
+ };
841
+ readonly url: string;
842
+ clone: () => Request;
843
+ readonly body: {
844
+ readonly locked: boolean;
845
+ cancel: (reason?: any) => Promise<void>;
846
+ getReader: {
847
+ (options: {
848
+ mode: "byob";
849
+ }): ReadableStreamBYOBReader;
850
+ (): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
851
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
852
+ };
853
+ pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
854
+ pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
855
+ tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
856
+ values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
857
+ [Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
858
+ } | null;
859
+ readonly bodyUsed: boolean;
860
+ arrayBuffer: () => Promise<ArrayBuffer>;
861
+ blob: () => Promise<Blob>;
862
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
863
+ formData: () => Promise<FormData>;
864
+ json: () => Promise<any>;
865
+ text: () => Promise<string>;
866
+ };
867
+ method: string;
868
+ path: string;
869
+ headers: {
870
+ append: (name: string, value: string) => void;
871
+ delete: (name: string) => void;
872
+ get: (name: string) => string | null;
873
+ getSetCookie: () => string[];
874
+ has: (name: string) => boolean;
875
+ set: (name: string, value: string) => void;
876
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
877
+ entries: () => HeadersIterator<[string, string]>;
878
+ keys: () => HeadersIterator<string>;
879
+ values: () => HeadersIterator<string>;
880
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
881
+ };
882
+ query: {
883
+ [x: string]: string | string[];
884
+ };
885
+ cookies: {
886
+ [x: string]: string;
887
+ };
888
+ body: unknown;
889
+ } & HttpRequest) | null | undefined;
890
+ res?: ({
891
+ headers: {
892
+ append: (name: string, value: string) => void;
893
+ delete: (name: string) => void;
894
+ get: (name: string) => string | null;
895
+ getSetCookie: () => string[];
896
+ has: (name: string) => boolean;
897
+ set: (name: string, value: string) => void;
898
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
899
+ entries: () => HeadersIterator<[string, string]>;
900
+ keys: () => HeadersIterator<string>;
901
+ values: () => HeadersIterator<string>;
902
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
903
+ };
904
+ status?: number | undefined;
905
+ statusText?: string | undefined;
906
+ } & HttpResponse) | null | undefined;
907
+ cookieOptions?: ({
908
+ maxAge?: number | undefined;
909
+ expires?: Date | undefined;
910
+ path?: string | undefined;
911
+ domain?: string | undefined;
912
+ secure?: boolean | undefined;
913
+ httpOnly?: boolean | undefined;
914
+ sameSite?: "strict" | "lax" | "none" | undefined;
915
+ } & {
916
+ maxAge?: number | undefined;
917
+ expires?: Date | undefined;
918
+ path?: string | undefined;
919
+ domain?: string | undefined;
920
+ secure?: boolean | undefined;
921
+ httpOnly?: boolean | undefined;
922
+ sameSite?: "strict" | "lax" | "none" | undefined;
923
+ }) | undefined;
924
+ }, unknown>;
925
+ setCookie: FnDefination<{
926
+ readonly name: string;
927
+ readonly value: string;
928
+ readonly options?: {
929
+ maxAge?: number | undefined;
930
+ expires?: Date | undefined;
931
+ path?: string | undefined;
932
+ domain?: string | undefined;
933
+ secure?: boolean | undefined;
934
+ httpOnly?: boolean | undefined;
935
+ sameSite?: "strict" | "lax" | "none" | undefined;
936
+ } | undefined;
937
+ }, {
938
+ set: boolean;
939
+ }, "cookie.set", {
940
+ readonly name: TypeDefination<string, string, never>;
941
+ readonly value: TypeDefination<string, string, never>;
942
+ readonly options: TypeDefination<{
943
+ maxAge?: number | undefined;
944
+ expires?: Date | undefined;
945
+ path?: string | undefined;
946
+ domain?: string | undefined;
947
+ secure?: boolean | undefined;
948
+ httpOnly?: boolean | undefined;
949
+ sameSite?: "strict" | "lax" | "none" | undefined;
950
+ }, {
951
+ maxAge?: number | undefined;
952
+ expires?: Date | undefined;
953
+ path?: string | undefined;
954
+ domain?: string | undefined;
955
+ secure?: boolean | undefined;
956
+ httpOnly?: boolean | undefined;
957
+ sameSite?: "strict" | "lax" | "none" | undefined;
958
+ } | undefined, undefined>;
959
+ }, readonly [], {}, {
960
+ req?: ({
961
+ raw: {
962
+ readonly cache: RequestCache;
963
+ readonly credentials: RequestCredentials;
964
+ readonly destination: RequestDestination;
965
+ readonly headers: {
966
+ append: (name: string, value: string) => void;
967
+ delete: (name: string) => void;
968
+ get: (name: string) => string | null;
969
+ getSetCookie: () => string[];
970
+ has: (name: string) => boolean;
971
+ set: (name: string, value: string) => void;
972
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
973
+ entries: () => HeadersIterator<[string, string]>;
974
+ keys: () => HeadersIterator<string>;
975
+ values: () => HeadersIterator<string>;
976
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
977
+ };
978
+ readonly integrity: string;
979
+ readonly keepalive: boolean;
980
+ readonly method: string;
981
+ readonly mode: RequestMode;
982
+ readonly redirect: RequestRedirect;
983
+ readonly referrer: string;
984
+ readonly referrerPolicy: ReferrerPolicy;
985
+ readonly signal: {
986
+ readonly aborted: boolean;
987
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
988
+ readonly reason: any;
989
+ throwIfAborted: () => void;
990
+ addEventListener: {
991
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
992
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
993
+ };
994
+ removeEventListener: {
995
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
996
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
997
+ };
998
+ dispatchEvent: (event: Event) => boolean;
999
+ };
1000
+ readonly url: string;
1001
+ clone: () => Request;
1002
+ readonly body: {
1003
+ readonly locked: boolean;
1004
+ cancel: (reason?: any) => Promise<void>;
1005
+ getReader: {
1006
+ (options: {
1007
+ mode: "byob";
1008
+ }): ReadableStreamBYOBReader;
1009
+ (): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
1010
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
1011
+ };
1012
+ pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
1013
+ pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
1014
+ tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
1015
+ values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
1016
+ [Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
1017
+ } | null;
1018
+ readonly bodyUsed: boolean;
1019
+ arrayBuffer: () => Promise<ArrayBuffer>;
1020
+ blob: () => Promise<Blob>;
1021
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
1022
+ formData: () => Promise<FormData>;
1023
+ json: () => Promise<any>;
1024
+ text: () => Promise<string>;
1025
+ };
1026
+ method: string;
1027
+ path: string;
1028
+ headers: {
1029
+ append: (name: string, value: string) => void;
1030
+ delete: (name: string) => void;
1031
+ get: (name: string) => string | null;
1032
+ getSetCookie: () => string[];
1033
+ has: (name: string) => boolean;
1034
+ set: (name: string, value: string) => void;
1035
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
1036
+ entries: () => HeadersIterator<[string, string]>;
1037
+ keys: () => HeadersIterator<string>;
1038
+ values: () => HeadersIterator<string>;
1039
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
1040
+ };
1041
+ query: {
1042
+ [x: string]: string | string[];
1043
+ };
1044
+ cookies: {
1045
+ [x: string]: string;
1046
+ };
1047
+ body: unknown;
1048
+ } & HttpRequest) | null | undefined;
1049
+ res?: ({
1050
+ headers: {
1051
+ append: (name: string, value: string) => void;
1052
+ delete: (name: string) => void;
1053
+ get: (name: string) => string | null;
1054
+ getSetCookie: () => string[];
1055
+ has: (name: string) => boolean;
1056
+ set: (name: string, value: string) => void;
1057
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
1058
+ entries: () => HeadersIterator<[string, string]>;
1059
+ keys: () => HeadersIterator<string>;
1060
+ values: () => HeadersIterator<string>;
1061
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
1062
+ };
1063
+ status?: number | undefined;
1064
+ statusText?: string | undefined;
1065
+ } & HttpResponse) | null | undefined;
1066
+ cookieOptions?: ({
1067
+ maxAge?: number | undefined;
1068
+ expires?: Date | undefined;
1069
+ path?: string | undefined;
1070
+ domain?: string | undefined;
1071
+ secure?: boolean | undefined;
1072
+ httpOnly?: boolean | undefined;
1073
+ sameSite?: "strict" | "lax" | "none" | undefined;
1074
+ } & {
1075
+ maxAge?: number | undefined;
1076
+ expires?: Date | undefined;
1077
+ path?: string | undefined;
1078
+ domain?: string | undefined;
1079
+ secure?: boolean | undefined;
1080
+ httpOnly?: boolean | undefined;
1081
+ sameSite?: "strict" | "lax" | "none" | undefined;
1082
+ }) | undefined;
1083
+ }, unknown>;
1084
+ deleteCookie: FnDefination<{
1085
+ readonly name: string;
1086
+ readonly options?: {
1087
+ maxAge?: number | undefined;
1088
+ expires?: Date | undefined;
1089
+ path?: string | undefined;
1090
+ domain?: string | undefined;
1091
+ secure?: boolean | undefined;
1092
+ httpOnly?: boolean | undefined;
1093
+ sameSite?: "strict" | "lax" | "none" | undefined;
1094
+ } | undefined;
1095
+ }, {
1096
+ set: boolean;
1097
+ }, "cookie.delete", {
1098
+ readonly name: TypeDefination<string, string, never>;
1099
+ readonly options: TypeDefination<{
1100
+ maxAge?: number | undefined;
1101
+ expires?: Date | undefined;
1102
+ path?: string | undefined;
1103
+ domain?: string | undefined;
1104
+ secure?: boolean | undefined;
1105
+ httpOnly?: boolean | undefined;
1106
+ sameSite?: "strict" | "lax" | "none" | undefined;
1107
+ }, {
1108
+ maxAge?: number | undefined;
1109
+ expires?: Date | undefined;
1110
+ path?: string | undefined;
1111
+ domain?: string | undefined;
1112
+ secure?: boolean | undefined;
1113
+ httpOnly?: boolean | undefined;
1114
+ sameSite?: "strict" | "lax" | "none" | undefined;
1115
+ } | undefined, undefined>;
1116
+ }, readonly [], {}, {
1117
+ req?: ({
1118
+ raw: {
1119
+ readonly cache: RequestCache;
1120
+ readonly credentials: RequestCredentials;
1121
+ readonly destination: RequestDestination;
1122
+ readonly headers: {
1123
+ append: (name: string, value: string) => void;
1124
+ delete: (name: string) => void;
1125
+ get: (name: string) => string | null;
1126
+ getSetCookie: () => string[];
1127
+ has: (name: string) => boolean;
1128
+ set: (name: string, value: string) => void;
1129
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
1130
+ entries: () => HeadersIterator<[string, string]>;
1131
+ keys: () => HeadersIterator<string>;
1132
+ values: () => HeadersIterator<string>;
1133
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
1134
+ };
1135
+ readonly integrity: string;
1136
+ readonly keepalive: boolean;
1137
+ readonly method: string;
1138
+ readonly mode: RequestMode;
1139
+ readonly redirect: RequestRedirect;
1140
+ readonly referrer: string;
1141
+ readonly referrerPolicy: ReferrerPolicy;
1142
+ readonly signal: {
1143
+ readonly aborted: boolean;
1144
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
1145
+ readonly reason: any;
1146
+ throwIfAborted: () => void;
1147
+ addEventListener: {
1148
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1149
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1150
+ };
1151
+ removeEventListener: {
1152
+ <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1153
+ (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1154
+ };
1155
+ dispatchEvent: (event: Event) => boolean;
1156
+ };
1157
+ readonly url: string;
1158
+ clone: () => Request;
1159
+ readonly body: {
1160
+ readonly locked: boolean;
1161
+ cancel: (reason?: any) => Promise<void>;
1162
+ getReader: {
1163
+ (options: {
1164
+ mode: "byob";
1165
+ }): ReadableStreamBYOBReader;
1166
+ (): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
1167
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
1168
+ };
1169
+ pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
1170
+ pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
1171
+ tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
1172
+ values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
1173
+ [Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
1174
+ } | null;
1175
+ readonly bodyUsed: boolean;
1176
+ arrayBuffer: () => Promise<ArrayBuffer>;
1177
+ blob: () => Promise<Blob>;
1178
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
1179
+ formData: () => Promise<FormData>;
1180
+ json: () => Promise<any>;
1181
+ text: () => Promise<string>;
1182
+ };
1183
+ method: string;
1184
+ path: string;
1185
+ headers: {
1186
+ append: (name: string, value: string) => void;
1187
+ delete: (name: string) => void;
1188
+ get: (name: string) => string | null;
1189
+ getSetCookie: () => string[];
1190
+ has: (name: string) => boolean;
1191
+ set: (name: string, value: string) => void;
1192
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
1193
+ entries: () => HeadersIterator<[string, string]>;
1194
+ keys: () => HeadersIterator<string>;
1195
+ values: () => HeadersIterator<string>;
1196
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
1197
+ };
1198
+ query: {
1199
+ [x: string]: string | string[];
1200
+ };
1201
+ cookies: {
1202
+ [x: string]: string;
1203
+ };
1204
+ body: unknown;
1205
+ } & HttpRequest) | null | undefined;
1206
+ res?: ({
1207
+ headers: {
1208
+ append: (name: string, value: string) => void;
1209
+ delete: (name: string) => void;
1210
+ get: (name: string) => string | null;
1211
+ getSetCookie: () => string[];
1212
+ has: (name: string) => boolean;
1213
+ set: (name: string, value: string) => void;
1214
+ forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
1215
+ entries: () => HeadersIterator<[string, string]>;
1216
+ keys: () => HeadersIterator<string>;
1217
+ values: () => HeadersIterator<string>;
1218
+ [Symbol.iterator]: () => HeadersIterator<[string, string]>;
1219
+ };
1220
+ status?: number | undefined;
1221
+ statusText?: string | undefined;
1222
+ } & HttpResponse) | null | undefined;
1223
+ cookieOptions?: ({
1224
+ maxAge?: number | undefined;
1225
+ expires?: Date | undefined;
1226
+ path?: string | undefined;
1227
+ domain?: string | undefined;
1228
+ secure?: boolean | undefined;
1229
+ httpOnly?: boolean | undefined;
1230
+ sameSite?: "strict" | "lax" | "none" | undefined;
1231
+ } & {
1232
+ maxAge?: number | undefined;
1233
+ expires?: Date | undefined;
1234
+ path?: string | undefined;
1235
+ domain?: string | undefined;
1236
+ secure?: boolean | undefined;
1237
+ httpOnly?: boolean | undefined;
1238
+ sameSite?: "strict" | "lax" | "none" | undefined;
1239
+ }) | undefined;
1240
+ readonly setCookie?: ((input: {
1241
+ readonly name: string;
1242
+ readonly value: string;
1243
+ readonly options?: {
1244
+ maxAge?: number | undefined;
1245
+ expires?: Date | undefined;
1246
+ path?: string | undefined;
1247
+ domain?: string | undefined;
1248
+ secure?: boolean | undefined;
1249
+ httpOnly?: boolean | undefined;
1250
+ sameSite?: "strict" | "lax" | "none" | undefined;
1251
+ } | undefined;
1252
+ }) => {
1253
+ set: boolean;
1254
+ }) | undefined;
1255
+ }, unknown>;
1256
+ req: VarDefination<"req", HttpRequest | null, undefined, never>;
1257
+ res: VarDefination<"res", HttpResponse | null, undefined, never>;
1258
+ };
1259
+ //#endregion
1260
+ export { CookieOptions, HttpRequest, HttpResponse, cookieOptions, cookieShape, deleteCookie, fromRequest, getCookie, http, req, res, setCookie, toHttpRequest };
1261
+ //# sourceMappingURL=http.d.cts.map